chrome-ext-oauth-sdk
v0.0.5
Published
OAuth SDK for Chrome Extensions
Downloads
4
Maintainers
Readme
Chrome Extension OAuth SDK
To implement OAuth flow on your Chrome Extension.
Why?
// TODO: Write something
How to use
// background.js
import { TwitterOAuth } from "chrome-ext-oauth-sdk";
window.twitter = new TwitterOAuth(yourConsumerConfig);
// Your callback page JavaScript
import { ProxyPage } from "chrome-ext-oauth-sdk";
const page = new ProxyPage();
window.onload = () => page.onload();
// then, this page will handle everything automatically
// and finally give token to the opener of this page.
// Let's open the page and trigger OAuth flow.
import { ProxyPage } from "chrome-ext-oauth-sdk";
const token = await ProxyPage.open(yourCallbackPageURL, "twitter");
// { access_token: string, access_token_secret: string }