Link

Getting Started

Considerations

HTTP Request Library

All web requests must use the Axios request library. Each Connector is provided with its own Axios Instance from yack-connector-framework. Axios Docs

Handling Promises

Yack’s Core Connectors and the yack-template-connector use async/await. We prefer async/await to other Promise implementations because we have found that it allows for cleaner code, better error handling, and easier debugging.

Async/Await Axios Example

export class ThreadProvider implements IThreadProvider {
    private pluginContext: PluginContext;
    constructor(context: PluginContext, channelProvider: IChannelProvider) {
        this.pluginContext = context;
        this.channelProvider = channelProvider;
    }

    async getThread(options: PluginRequestOptions, threadQuery: Thread.Query): Promise<Result<Thread>> {
        const url = "https://jsonplaceholder.typicode.com/posts/1";

        // Using a Connector's inherited Axios Instance
        const response = await this.pluginContext.axios.get(url);
    }
}


Table of contents