variable / @typed/id/NanoId

NanoId

Effect Schema and branded string type for URL-safe Nano IDs.

Package version
1.0.0-beta.7
Category
ID schemas
Since
1.0.0

Import

import { NanoId } from "@typed/id/NanoId";

Signatures

export declare const NanoId: Schema.brand<Schema.String, "@typed/id/NanoId">;
export type NanoId = typeof NanoId.Type;

Why

Runtime validation restores the brand after transport and prevents arbitrary strings from entering NanoId-specific APIs.

Ownership and lifetime

This module-level schema value acquires no resources and is shared; no runtime freezing guarantee is implied.

Examples

import { NanoId } from "@typed/id/NanoId"
const id = NanoId.make("V1StGXR8_Z5jdHi6B-myT")

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source