Skip to content

Commit c432577

Browse files
authored
docs: add jwt schema docs (#4867)
1 parent 7c9ce38 commit c432577

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/docs/content/api.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ z.hostname();
232232
z.emoji(); // validates a single emoji character
233233
z.base64();
234234
z.base64url();
235+
z.jwt();
235236
z.nanoid();
236237
z.cuid();
237238
z.cuid2();
@@ -493,6 +494,15 @@ const cidrv6 = z.string().cidrv6();
493494
cidrv6.parse("2001:db8::/32"); //
494495
```
495496

497+
### JWTs
498+
499+
Validate [JSON Web Tokens](https://jwt.io/).
500+
501+
```ts
502+
z.jwt();
503+
z.jwt({ alg: "HS256" });
504+
```
505+
496506
## Template literals
497507

498508
> **New in Zod 4**

0 commit comments

Comments
 (0)