soundcloud-api-ts-next
    Preparing search index...

    Class MemoryPkceStore

    In-memory PkceStore implementation.

    Stores PKCE verifiers in a Map keyed by OAuth state token, with TTL-based eviction. This is the default behavior of SCAuthManager when no custom pkceStore is provided.

    Suitable for: Single-instance Node.js servers with long-lived processes.

    Not suitable for: Serverless (Vercel, AWS Lambda), edge runtimes, or any deployment with multiple server instances — verifiers are not shared across processes. Use CookiePkceStore or a Redis adapter instead.

    import { createSCAuthManager, MemoryPkceStore } from "soundcloud-api-ts-next/server";

    const scAuth = createSCAuthManager({
    clientId: process.env.SC_CLIENT_ID!,
    clientSecret: process.env.SC_CLIENT_SECRET!,
    redirectUri: process.env.SC_REDIRECT_URI!,
    pkceStore: new MemoryPkceStore(),
    });

    Implements

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods

    • Retrieve the verifier for state. Returns undefined if the entry doesn't exist or has expired.

      Parameters

      • state: string

      Returns string | undefined

    • Store a PKCE verifier for state, expiring after ttlMs milliseconds. Evicts any previously-expired entries before storing.

      Parameters

      • state: string
      • verifier: string
      • ttlMs: number

      Returns void