@audiotool/nexus - v0.0.17
    Preparing search index...

    Type Alias AudiotoolClient

    An instance of the client that's authorized to make calls on a user's behalf.

    Provides direct access to all Audiotool services and the ability to open projects for real-time collaboration.

    // Browser app
    import { audiotool } from "@audiotool/nexus"
    const at = await audiotool({...})
    if (at.status === "authenticated") {
    const projects = await at.projects.listProjects({})
    const doc = await at.open(projects.projects[0].name)
    }

    // Node.js app (with tokens from browser OAuth)
    import { createAudiotoolClient, createServerAuth } from "@audiotool/nexus"
    import { createNodeTransport, createDiskWasmLoader } from "@audiotool/nexus/node"
    const client = await createAudiotoolClient({
    auth: createServerAuth({ accessToken, refreshToken, expiresAt, clientId }),
    transport: createNodeTransport(),
    wasm: createDiskWasmLoader(),
    })
    const projects = await client.projects.listProjects({})
    type AudiotoolClient = {
        audioGraph: RetryingClient<typeof AudiographService>;
        authorizedFetch: NeverThrowingFetch;
        fetch: NeverThrowingFetch;
        open: (project: string) => Promise<SyncedDocument>;
        presets: PresetsAPI;
        projectRoles: RetryingClient<typeof ProjectRoleService>;
        projects: RetryingClient<typeof ProjectService>;
        samples: SamplesAPI;
        users: RetryingClient<typeof UserService>;
    }
    Index

    Properties

    audioGraph: RetryingClient<typeof AudiographService>

    Manage audio graphs (waveform plots for samples).

    authorizedFetch: NeverThrowingFetch

    Fetch with authorization headers included. Never throws - returns Error on failure.

    Fetch without authorization. Never throws - returns Error on failure.

    open: (project: string) => Promise<SyncedDocument>

    Open a project for real-time collaboration.

    Returns a SyncedDocument that syncs with the Audiotool backend. Call SyncedDocument.start to begin syncing and SyncedDocument.stop when done.

    Type declaration

    const doc = await client.open("https://beta.audiotool.com/studio?project=abc123")
    await doc.start()
    // ... work with the document
    await doc.stop()
    presets: PresetsAPI

    Work with presets - get, apply, and manage device presets.

    projectRoles: RetryingClient<typeof ProjectRoleService>

    Add collaborators to your projects.

    projects: RetryingClient<typeof ProjectService>

    Lookup, create, and delete projects.

    samples: SamplesAPI

    Upload, download, and manage audio samples.

    const upload = await at.samples.upload({
    file: audioFile,
    displayName: "My Kick",
    })
    await upload.uploaded // bytes are safely on the server
    const blob = await at.samples.download("samples/abc-123", { format: "wav" })
    

    Lookup users.