@zyphr-dev/node-sdk 0.1.12 → 0.1.14

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/dist/index.d.cts CHANGED
@@ -22506,6 +22506,22 @@ declare class Zyphr {
22506
22506
  readonly webauthn: AuthWebAuthnApi;
22507
22507
  };
22508
22508
  constructor(options: ZyphrOptions);
22509
+ /**
22510
+ * Create request overrides that authenticate as an end user.
22511
+ * Use this when calling profile, session, or MFA endpoints that
22512
+ * require the end user's access token instead of the API key.
22513
+ *
22514
+ * @example
22515
+ * ```ts
22516
+ * const login = await zyphr.auth.login.loginEndUser({ ... });
22517
+ * const token = login.data.tokens.access_token;
22518
+ *
22519
+ * const profile = await zyphr.auth.profile.getEndUser(
22520
+ * zyphr.asEndUser(token)
22521
+ * );
22522
+ * ```
22523
+ */
22524
+ asEndUser(accessToken: string): RequestInit;
22509
22525
  }
22510
22526
 
22511
22527
  /**
package/dist/index.d.ts CHANGED
@@ -22506,6 +22506,22 @@ declare class Zyphr {
22506
22506
  readonly webauthn: AuthWebAuthnApi;
22507
22507
  };
22508
22508
  constructor(options: ZyphrOptions);
22509
+ /**
22510
+ * Create request overrides that authenticate as an end user.
22511
+ * Use this when calling profile, session, or MFA endpoints that
22512
+ * require the end user's access token instead of the API key.
22513
+ *
22514
+ * @example
22515
+ * ```ts
22516
+ * const login = await zyphr.auth.login.loginEndUser({ ... });
22517
+ * const token = login.data.tokens.access_token;
22518
+ *
22519
+ * const profile = await zyphr.auth.profile.getEndUser(
22520
+ * zyphr.asEndUser(token)
22521
+ * );
22522
+ * ```
22523
+ */
22524
+ asEndUser(accessToken: string): RequestInit;
22509
22525
  }
22510
22526
 
22511
22527
  /**
package/dist/index.js CHANGED
@@ -17919,6 +17919,26 @@ var Zyphr = class {
17919
17919
  webauthn: new AuthWebAuthnApi(config)
17920
17920
  };
17921
17921
  }
17922
+ /**
17923
+ * Create request overrides that authenticate as an end user.
17924
+ * Use this when calling profile, session, or MFA endpoints that
17925
+ * require the end user's access token instead of the API key.
17926
+ *
17927
+ * @example
17928
+ * ```ts
17929
+ * const login = await zyphr.auth.login.loginEndUser({ ... });
17930
+ * const token = login.data.tokens.access_token;
17931
+ *
17932
+ * const profile = await zyphr.auth.profile.getEndUser(
17933
+ * zyphr.asEndUser(token)
17934
+ * );
17935
+ * ```
17936
+ */
17937
+ asEndUser(accessToken) {
17938
+ return {
17939
+ headers: { Authorization: `Bearer ${accessToken}` }
17940
+ };
17941
+ }
17922
17942
  };
17923
17943
 
17924
17944
  // src/index.ts