madon icon indicating copy to clipboard operation
madon copied to clipboard

How to instantiate a client with access token?

Open teabroker opened this issue 1 year ago • 0 comments

In other libraries there is a method to instantiate a client with an access token and an endpoint url, like this one from masto.js:

import { createRestAPIClient } from "masto";

const masto = createRestAPIClient({
  url: process.env.URL,
  accessToken: process.env.TOKEN,
});

or megalodon-rs (rust):

let client = megalodon::generator(
  megalodon::SNS::Mastodon,
  String::from("https://fedibird.com"),
  Some(String::from("your access token")),
  None,
);

Is there an equal method to instantiate a client?

teabroker avatar Oct 16 '23 11:10 teabroker