@zyphr-dev/node-sdk 0.1.43 → 0.1.45
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/README.md +6 -4
- package/dist/index.cjs +511 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +522 -21
- package/dist/index.d.ts +522 -21
- package/dist/index.js +472 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +8 -0
- package/src/client.ts +18 -3
- package/src/clientAuth.ts +45 -12
- package/src/src/apis/AuthApplicationApi.ts +162 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +4 -4
- package/src/src/apis/AuthUserDirectoryApi.ts +66 -0
- package/src/src/apis/AuthUserProfileApi.ts +76 -0
- package/src/src/apis/index.ts +1 -0
- package/src/src/models/ApplicationSelf.ts +127 -0
- package/src/src/models/ApplicationSelfResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateTestRequest.ts +1 -1
- package/src/src/models/AuthMethods.ts +111 -0
- package/src/src/models/ChangePasswordRequest.ts +75 -0
- package/src/src/models/GetEndUserAuthMethods200Response.ts +88 -0
- package/src/src/models/SetSelfApplicationTestRecipientsRequest.ts +66 -0
- package/src/src/models/WebhookDelivery.ts +12 -4
- package/src/src/models/WebhookDeliveryDetail.ts +12 -4
- package/src/src/models/WebhookEventType.ts +79 -0
- package/src/src/models/WebhookEventTypesResponseData.ts +12 -4
- package/src/src/models/WebhookTestEventResponseData.ts +14 -4
- package/src/src/models/index.ts +7 -0
package/README.md
CHANGED
|
@@ -381,16 +381,18 @@ await zyphr.devices.deleteUserDevices('user_123');
|
|
|
381
381
|
|
|
382
382
|
Full Auth-as-a-Service API for end-user authentication: registration, login, MFA, magic links, OAuth, and more.
|
|
383
383
|
|
|
384
|
-
> **Important:** Auth endpoints
|
|
384
|
+
> **Important:** Auth endpoints use **Application-scoped** credentials (`X-Application-Key` + `X-Application-Secret`), which are distinct from the **Project-scoped** notification API key (`zy_live_*` / `zy_test_*`, sent as `Authorization: Bearer`). Create an application in the Zyphr dashboard first, then pass the credentials when constructing the client:
|
|
385
385
|
|
|
386
386
|
```ts
|
|
387
387
|
const zyphr = new Zyphr({
|
|
388
|
-
apiKey: process.env.ZYPHR_API_KEY!,
|
|
389
|
-
applicationKey: process.env.ZYPHR_APP_PUBLIC_KEY!,
|
|
390
|
-
applicationSecret: process.env.ZYPHR_APP_SECRET_KEY!, //
|
|
388
|
+
apiKey: process.env.ZYPHR_API_KEY!, // Project-scoped: zy_live_* / zy_test_*
|
|
389
|
+
applicationKey: process.env.ZYPHR_APP_PUBLIC_KEY!, // Application-scoped public: za_live_pub_* / za_test_pub_*
|
|
390
|
+
applicationSecret: process.env.ZYPHR_APP_SECRET_KEY!, // Application-scoped secret: za_live_sec_* / za_test_sec_*
|
|
391
391
|
});
|
|
392
392
|
```
|
|
393
393
|
|
|
394
|
+
> Legacy `za_pub_*` / `za_sec_*` application-key prefixes are deprecated but still accepted.
|
|
395
|
+
|
|
394
396
|
> **Common mistake:** `POST /v1/auth/register` creates a **platform account** (for the Zyphr dashboard). To register **end users** in your application, use `POST /v1/auth/users/register` via `zyphr.auth.registration.registerEndUser()`.
|
|
395
397
|
|
|
396
398
|
```ts
|