@productcraft/waitlist 0.2.2 → 0.2.4
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 +8 -8
- package/dist/index.d.cts +425 -64
- package/dist/index.d.ts +425 -64
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The waitlist-entries endpoint can be called unauthenticated from a marketing-sit
|
|
|
10
10
|
|
|
11
11
|
## Quick start — accept a signup from a public form
|
|
12
12
|
|
|
13
|
-
```ts
|
|
13
|
+
```ts before
|
|
14
14
|
import { Waitlist } from "@productcraft/waitlist";
|
|
15
15
|
|
|
16
16
|
// No auth — public surface
|
|
@@ -37,7 +37,7 @@ If the waitlist has `settings.recaptcha_site_key` set, also pass a `recaptcha_to
|
|
|
37
37
|
|
|
38
38
|
## Quick start — workspace-admin (authenticated)
|
|
39
39
|
|
|
40
|
-
```ts
|
|
40
|
+
```ts before
|
|
41
41
|
import { Waitlist } from "@productcraft/waitlist";
|
|
42
42
|
|
|
43
43
|
// Reads PRODUCTCRAFT_API_KEY from the environment
|
|
@@ -70,7 +70,7 @@ PRODUCTCRAFT_API_KEY=pcft_live_...
|
|
|
70
70
|
|
|
71
71
|
## Configuration
|
|
72
72
|
|
|
73
|
-
```ts
|
|
73
|
+
```ts before
|
|
74
74
|
new Waitlist({
|
|
75
75
|
// Optional: required for workspace-admin calls. Public submit works without auth.
|
|
76
76
|
// Omit to use PRODUCTCRAFT_API_KEY from the environment
|
|
@@ -86,7 +86,7 @@ new Waitlist({
|
|
|
86
86
|
|
|
87
87
|
### Public surface
|
|
88
88
|
|
|
89
|
-
```ts
|
|
89
|
+
```ts before
|
|
90
90
|
// Read the waitlist's public metadata (name, position-window, active variant, ...)
|
|
91
91
|
await waitlist.client.GET(
|
|
92
92
|
"/v1/waitlists/{workspace_slug}/{waitlist_slug}",
|
|
@@ -102,7 +102,7 @@ await waitlist.client.GET(
|
|
|
102
102
|
|
|
103
103
|
### Entries (workspace-admin)
|
|
104
104
|
|
|
105
|
-
```ts
|
|
105
|
+
```ts before
|
|
106
106
|
// List entries
|
|
107
107
|
await waitlist.client.GET(
|
|
108
108
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/entries",
|
|
@@ -138,7 +138,7 @@ await waitlist.client.GET(
|
|
|
138
138
|
|
|
139
139
|
Variants split two ways: `kind: "ab"` for split-traffic A/B/n tests, or `kind: "locale"` for per-locale copy switching. Pick one; the body shape is `{ kind, slug, locale? }`.
|
|
140
140
|
|
|
141
|
-
```ts
|
|
141
|
+
```ts before
|
|
142
142
|
// A/B variant
|
|
143
143
|
await waitlist.client.POST(
|
|
144
144
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/variants",
|
|
@@ -162,7 +162,7 @@ Front-end picks up the active variant from `GET /v1/waitlists/:workspace_slug/:w
|
|
|
162
162
|
|
|
163
163
|
### Analytics
|
|
164
164
|
|
|
165
|
-
```ts
|
|
165
|
+
```ts before
|
|
166
166
|
// Conversion + per-variant counts
|
|
167
167
|
await waitlist.client.GET(
|
|
168
168
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/analytics",
|
|
@@ -184,7 +184,7 @@ await waitlist.client.GET(
|
|
|
184
184
|
|
|
185
185
|
### Webhooks
|
|
186
186
|
|
|
187
|
-
```ts
|
|
187
|
+
```ts before
|
|
188
188
|
// Subscribe to entry.created / entry.approved / entry.rejected
|
|
189
189
|
await waitlist.client.POST(
|
|
190
190
|
"/v1/workspaces/{workspace_id}/webhooks",
|