UNPKG

2.48 kBTypeScriptView Raw
1import { DsnLike, SdkMetadata } from '@sentry/types';
2import { Dsn } from '@sentry/utils';
3/**
4 * Helper class to provide urls, headers and metadata that can be used to form
5 * different types of requests to Sentry endpoints.
6 * Supports both envelopes and regular event requests.
7 **/
8export declare class API {
9 /** The DSN as passed to Sentry.init() */
10 dsn: DsnLike;
11 /** Metadata about the SDK (name, version, etc) for inclusion in envelope headers */
12 metadata: SdkMetadata;
13 /** The internally used Dsn object. */
14 private readonly _dsnObject;
15 /** The envelope tunnel to use. */
16 private readonly _tunnel?;
17 /** Create a new instance of API */
18 constructor(dsn: DsnLike, metadata?: SdkMetadata, tunnel?: string);
19 /** Returns the Dsn object. */
20 getDsn(): Dsn;
21 /** Does this transport force envelopes? */
22 forceEnvelope(): boolean;
23 /** Returns the prefix to construct Sentry ingestion API endpoints. */
24 getBaseApiEndpoint(): string;
25 /** Returns the store endpoint URL. */
26 getStoreEndpoint(): string;
27 /**
28 * Returns the store endpoint URL with auth in the query string.
29 *
30 * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
31 */
32 getStoreEndpointWithUrlEncodedAuth(): string;
33 /**
34 * Returns the envelope endpoint URL with auth in the query string.
35 *
36 * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
37 */
38 getEnvelopeEndpointWithUrlEncodedAuth(): string;
39 /** Returns only the path component for the store endpoint. */
40 getStoreEndpointPath(): string;
41 /**
42 * Returns an object that can be used in request headers.
43 * This is needed for node and the old /store endpoint in sentry
44 */
45 getRequestHeaders(clientName: string, clientVersion: string): {
46 [key: string]: string;
47 };
48 /** Returns the url to the report dialog endpoint. */
49 getReportDialogEndpoint(dialogOptions?: {
50 [key: string]: any;
51 user?: {
52 name?: string;
53 email?: string;
54 };
55 }): string;
56 /** Returns the envelope endpoint URL. */
57 private _getEnvelopeEndpoint;
58 /** Returns the ingest API endpoint for target. */
59 private _getIngestEndpoint;
60 /** Returns a URL-encoded string with auth config suitable for a query string. */
61 private _encodedAuth;
62}
63//# sourceMappingURL=api.d.ts.map
\No newline at end of file