Skip to content

Instantly share code, notes, and snippets.

@xinha-sh
xinha-sh / client.ts
Last active June 27, 2025 17:21
Expo auth implementation using SST Auth V2
import type { StandardSchemaV1 } from "@standard-schema/spec";
import { type JSONWebKeySet, createLocalJWKSet, errors, jwtVerify } from "jose";
import {
InvalidAuthorizationCodeError,
InvalidRefreshTokenError,
InvalidSessionError,
} from "./error";
import { generatePKCE } from "./pkce";
import type { SubjectSchema } from "./session";
@xinha-sh
xinha-sh / html-meta-schema.ts
Created January 3, 2024 08:30
Typescript schema for html meta including open-graph, twitter and o-embed
import { z } from "zod"
const metadataSchema = z.object({
title: z.string().optional(),
description: z.string().optional(),
keywords: z.array(z.string()).optional(),
favicon: z.string().optional(),
author: z.string().optional(),
themeColor: z.string().optional(),
canonicalUrl: z.string().optional(),