The API interface provided to custom subtask handlers for interacting with the Twitter authentication flow.
This interface allows handlers to send flow requests and access the current flow token.
The API is passed to each subtask handler and provides methods necessary for implementing
custom authentication subtasks. It abstracts away the low-level details of communicating
with Twitter's authentication API.
// A custom subtask handler that implements a hypothetical example subtask constexampleHandler: FlowSubtaskHandler = async (subtaskId, response, credentials, api) => { // Process the example subtask somehow constdata = awaitprocessExampleTask();
// Submit the processed data using the provided API returnawaitapi.sendFlowRequest({ flow_token:api.getFlowToken(), subtask_inputs: [{ subtask_id:subtaskId, example_data: { value:data, link:"next_link" } }] }); };
The API interface provided to custom subtask handlers for interacting with the Twitter authentication flow. This interface allows handlers to send flow requests and access the current flow token.
The API is passed to each subtask handler and provides methods necessary for implementing custom authentication subtasks. It abstracts away the low-level details of communicating with Twitter's authentication API.
Example