@voyantjs/storefront-verification 0.32.3 → 0.34.0

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.
Files changed (2) hide show
  1. package/README.md +85 -0
  2. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ # @voyantjs/storefront-verification
2
+
3
+ Public email and SMS verification challenges for storefront and checkout flows.
4
+
5
+ The package ships:
6
+
7
+ - a Hono public route module for `/v1/public/storefront-verification`
8
+ - a service for issuing, sending, and confirming verification challenges
9
+ - provider adapters that reuse `@voyantjs/notifications` providers
10
+ - a Drizzle schema for persisted verification challenge state
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pnpm add @voyantjs/storefront-verification
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { createStorefrontVerificationHonoModule } from "@voyantjs/storefront-verification"
22
+
23
+ const storefrontVerification = createStorefrontVerificationHonoModule({
24
+ resolveProviders: (bindings) => [
25
+ // return NotificationProvider instances for email and/or sms
26
+ ],
27
+ email: {
28
+ subject: "Your verification code",
29
+ },
30
+ })
31
+ ```
32
+
33
+ Mount the returned module in the same app that exposes the public route:
34
+
35
+ ```ts
36
+ createApp({
37
+ publicPaths: ["/v1/public/storefront-verification"],
38
+ modules: [storefrontVerification],
39
+ })
40
+ ```
41
+
42
+ ## Database Schema
43
+
44
+ This module stores challenge rows in `storefront_verification_challenges`.
45
+ Apps that maintain an explicit Drizzle schema array must include the schema
46
+ entrypoint before generating migrations:
47
+
48
+ ```ts
49
+ export default defineConfig({
50
+ schema: [
51
+ "../../packages/db/src/schema/index.ts",
52
+ "../../packages/storefront-verification/src/schema.ts",
53
+ ],
54
+ })
55
+ ```
56
+
57
+ For package-based tooling, the published package declares:
58
+
59
+ ```json
60
+ {
61
+ "voyant": {
62
+ "schema": "./schema",
63
+ "requiresSchemas": ["@voyantjs/db"]
64
+ }
65
+ }
66
+ ```
67
+
68
+ The first-party DMC and operator templates include this schema and ship a
69
+ migration for the challenge table. Downstream apps that mount the route module
70
+ should do the same; otherwise the first verification request will fail when the
71
+ service tries to read or write `storefront_verification_challenges`.
72
+
73
+ ## Exports
74
+
75
+ | Entry | Description |
76
+ | --- | --- |
77
+ | `.` | Hono module factory, service exports, validation exports, schema exports |
78
+ | `./schema` | Drizzle tables, enums, linkable metadata, module definition |
79
+ | `./public-routes` | Public route factory |
80
+ | `./service` | Verification service and provider adapter helpers |
81
+ | `./validation` | Zod request/response schemas |
82
+
83
+ ## License
84
+
85
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/storefront-verification",
3
- "version": "0.32.3",
3
+ "version": "0.34.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,10 +34,10 @@
34
34
  "drizzle-orm": "^0.45.2",
35
35
  "hono": "^4.12.10",
36
36
  "zod": "^4.3.6",
37
- "@voyantjs/core": "0.32.3",
38
- "@voyantjs/db": "0.32.3",
39
- "@voyantjs/notifications": "0.32.3",
40
- "@voyantjs/hono": "0.32.3"
37
+ "@voyantjs/db": "0.34.0",
38
+ "@voyantjs/notifications": "0.34.0",
39
+ "@voyantjs/core": "0.34.0",
40
+ "@voyantjs/hono": "0.34.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "typescript": "^6.0.2",