From 3acd8231e0c46487f0947e077dbd7e90bf3dbea8 Mon Sep 17 00:00:00 2001 From: Victor Bojica Date: Wed, 18 Sep 2024 18:50:40 +0300 Subject: [PATCH] updated public endpoints for attack detection --- v2/attackprotectionsuite/frontend-setup.mdx | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/v2/attackprotectionsuite/frontend-setup.mdx b/v2/attackprotectionsuite/frontend-setup.mdx index 25add67d2..cc5bd5e94 100644 --- a/v2/attackprotectionsuite/frontend-setup.mdx +++ b/v2/attackprotectionsuite/frontend-setup.mdx @@ -21,18 +21,19 @@ Below is an example of how to implement request ID generation on your frontend: ```tsx const PUBLIC_API_KEY = ""; // Your public API key that you received from the SuperTokens team -const SDK_URL = "https://supertokens.io/O6edpVVvewh85qFE/Z921AQOtdL6LpZvf"; +const SDK_URL = "https://deviceid.supertokens.io/PqWNQ35Ydhm6WDUK/k9bwGCuvuA83Ad6s"; +const PROXY_ENDPOINT_URL = "https://deviceid.supertokens.io/PqWNQ35Ydhm6WDUK/CnsdzKsyFKU8Q3h2" const ENVIRONMENT_ID = ""; // Your environment ID that you received from the SuperTokens team - -const supertokensAnomalyDetectionSdkPromise = import(SDK_URL + "?apiKey=" + PUBLIC_API_KEY).then((RequestId: any) => RequestId.load({ +// Initialize the agent on page load. +const supertokensRequestIdPromise = import(SDK_URL + "?apiKey=" + PUBLIC_API_KEY).then((RequestId: any) => RequestId.load({ endpoint: [ - SDK_URL, + PROXY_ENDPOINT_URL, RequestId.defaultEndpoint ] })); async function getRequestId() { - const sdk = await supertokensAnomalyDetectionSdkPromise; + const sdk = await supertokensRequestIdPromise; const result = await sdk.get({ tag: { environmentId: ENVIRONMENT_ID, @@ -55,19 +56,20 @@ Below is a full example of how to configure the SDK and pass the request ID to t import EmailPassword from "supertokens-auth-react/recipe/emailpassword"; const PUBLIC_API_KEY = ""; // Your public API key that you received from the SuperTokens team -const SDK_URL = "https://supertokens.io/JfNbWqtXUiGYuTqb/PYmK3PIPqdvHw6iz"; +const SDK_URL = "https://deviceid.supertokens.io/PqWNQ35Ydhm6WDUK/k9bwGCuvuA83Ad6s"; +const PROXY_ENDPOINT_URL = "https://deviceid.supertokens.io/PqWNQ35Ydhm6WDUK/CnsdzKsyFKU8Q3h2" const ENVIRONMENT_ID = ""; // Your environment ID that you received from the SuperTokens team - +// Initialize the agent on page load. const supertokensRequestIdPromise = import(SDK_URL + "?apiKey=" + PUBLIC_API_KEY).then((RequestId: any) => RequestId.load({ endpoint: [ - SDK_URL, + PROXY_ENDPOINT_URL, RequestId.defaultEndpoint ] })); async function getRequestId() { - const requestId = await supertokensRequestIdPromise; - const result = await requestId.get({ + const sdk = await supertokensRequestIdPromise; + const result = await sdk.get({ tag: { environmentId: ENVIRONMENT_ID, }