masto
    Preparing search index...

    Interface WebSocketConfigProps

    interface WebSocketConfigProps {
        accessToken?: string;
        retry?: number | boolean;
        streamingApiUrl: string;
        useInsecureAccessToken?: boolean;
    }
    Index

    Properties

    accessToken?: string

    Access token for the streaming API.

    If it is not provided, you won't be able to use private APIs.

    retry?: number | boolean

    Whether to retry the connection when it fails.

    • If true, it will retry indefinitely.
    • If false, it will not retry.
    • If a number, it will retry that many times.

    Defaults to true.

    streamingApiUrl: string

    Streaming API URL for your Mastodon instance.

    Note that this is often different from the REST API URL.

    If you are not sure which URL to use, you can obtain it via the following script:

    import { createRestAPIClient, createStreamingAPIClient } from "masto";

    const rest = createRestAPIClient({
    url: "https://example.com",
    });

    const instance = await rest.v2.instance.fetch();

    const streaming = createStreamingAPIClient({
    streamingApiUrl: instance.configuration.urls.streaming,
    })
    useInsecureAccessToken?: boolean

    Whether to use the access token as a query parameter.

    This is useful when your instance runs an old version of Mastodon that does not support the Sec-Websocket-Protocols

    Defaults to false.