@schibsted/account-sdk-browser 4.8.3 → 4.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schibsted/account-sdk-browser",
3
- "version": "4.8.3",
3
+ "version": "4.8.5",
4
4
  "description": "Schibsted account SDK for browsers",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/identity.d.ts CHANGED
@@ -220,6 +220,36 @@ export class Identity extends TinyEmitter {
220
220
  * @return {Promise<SimplifiedLoginData|null>}
221
221
  */
222
222
  getUserContextData(): Promise<SimplifiedLoginData | null>;
223
+ /**
224
+ * @async
225
+ * @function
226
+ * @summary
227
+ * Retrieves the external identifier (`externalId`) for the authenticated user.
228
+ *
229
+ * In Schibsted Account there are multiple ways of identifying users, however for integrations with
230
+ * third-parties it's recommended to use `externalId` as it does not disclose
231
+ * any critical data whilst allowing for user identification.
232
+ *
233
+ * `externalId` is merchant-scoped using a pairwise identifier (`pairId`),
234
+ * meaning the same user's ID will differ between merchants.
235
+ * Additionally, this identifier is bound to the external party provided as argument.
236
+ *
237
+ * @description This function calls {@link Identity#hasSession} internally and thus has the side
238
+ * effect that it might perform an auto-login on the user
239
+ * @throws {SDKError} If the `pairId` is missing in user session.
240
+ * @throws {SDKError} If the `externalParty` is not defined
241
+ * @return {Promise<string>} The merchant- and 3rd-party-specific `externalId`
242
+ */
243
+ getExternalId(externalParty: string, optionalSuffix?: string): Promise<string>;
244
+ /**
245
+ * @async
246
+ * @summary Enables brands to programmatically get the current the SDRN based on the user's session.
247
+ * @description This function calls {@link Identity#hasSession} internally and thus has the side
248
+ * effect that it might perform an auto-login on the user
249
+ * @throws {SDKError} If the SDRN is missing in user session object.
250
+ * @returns {Promise<string>}
251
+ */
252
+ getUserSDRN(): Promise<string>;
223
253
  /**
224
254
  * If a popup is desired, this function needs to be called in response to a user event (like
225
255
  * click or tap) in order to work correctly. Otherwise the popup will be blocked by the
@@ -580,5 +610,5 @@ export type SimplifiedLoginWidgetOptions = {
580
610
  */
581
611
  locale?: "nb"|"sv"|"fi"|"da"|"en";
582
612
  };
583
- import RESTClient from "./RESTClient";
584
- import SDKError from "./SDKError";
613
+ import RESTClient from "./RESTClient.js";
614
+ import SDKError from "./SDKError.js";
@@ -77,4 +77,4 @@ export class Monetization {
77
77
  productsUrl(redirectUri?: string): string;
78
78
  }
79
79
  export default Monetization;
80
- import RESTClient from "./RESTClient";
80
+ import RESTClient from "./RESTClient.js";
package/src/payment.d.ts CHANGED
@@ -112,4 +112,4 @@ export class Payment {
112
112
  purchasePromoCodeProductFlowUrl(code: string, state?: string, redirectUri?: string): string;
113
113
  }
114
114
  export default Payment;
115
- import RESTClient from "./RESTClient";
115
+ import RESTClient from "./RESTClient.js";
package/src/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Automatically generated in 'npm version' by scripts/genversion.js
2
2
 
3
3
  'use strict'
4
- const version = '4.8.3';
4
+ const version = '4.8.5';
5
5
  export default version;