@zyphr-dev/node-sdk 0.1.14 → 0.1.16
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.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +12 -2
package/dist/index.cjs
CHANGED
|
@@ -19675,7 +19675,9 @@ var Zyphr = class {
|
|
|
19675
19675
|
devices;
|
|
19676
19676
|
waas;
|
|
19677
19677
|
auth;
|
|
19678
|
+
options;
|
|
19678
19679
|
constructor(options) {
|
|
19680
|
+
this.options = options;
|
|
19679
19681
|
const config = new Configuration({
|
|
19680
19682
|
basePath: options.baseUrl,
|
|
19681
19683
|
apiKey: (name) => {
|
|
@@ -19721,6 +19723,9 @@ var Zyphr = class {
|
|
|
19721
19723
|
* Use this when calling profile, session, or MFA endpoints that
|
|
19722
19724
|
* require the end user's access token instead of the API key.
|
|
19723
19725
|
*
|
|
19726
|
+
* Includes both the end-user Bearer token and the application
|
|
19727
|
+
* public key (X-Application-Key) required by user-scoped endpoints.
|
|
19728
|
+
*
|
|
19724
19729
|
* @example
|
|
19725
19730
|
* ```ts
|
|
19726
19731
|
* const login = await zyphr.auth.login.loginEndUser({ ... });
|
|
@@ -19732,9 +19737,13 @@ var Zyphr = class {
|
|
|
19732
19737
|
* ```
|
|
19733
19738
|
*/
|
|
19734
19739
|
asEndUser(accessToken) {
|
|
19735
|
-
|
|
19736
|
-
|
|
19740
|
+
const headers = {
|
|
19741
|
+
Authorization: `Bearer ${accessToken}`
|
|
19737
19742
|
};
|
|
19743
|
+
if (this.options.applicationKey) {
|
|
19744
|
+
headers["X-Application-Key"] = this.options.applicationKey;
|
|
19745
|
+
}
|
|
19746
|
+
return { headers };
|
|
19738
19747
|
}
|
|
19739
19748
|
};
|
|
19740
19749
|
|