npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@capacitor-community/twitter

v3.0.2

Published

Enable TwitterKit features for Capacitor

Downloads

52

Readme

Sponsors

Maintainers

| Maintainer | GitHub | Social | | ------------ | --------------------------------------- | ----------------------------------------- | | Stewan Silva | stewones | @stewones |

Notice 🚀

We're starting fresh under an official org. If you were using the previous npm package capacitor-twitter, please update your package.json to @capacitor-community/twitter. Check out changelog for more info.

Installation

Using npm:

npm install @capacitor-community/twitter

Using yarn:

yarn add @capacitor-community/twitter

Sync native files:

npx cap sync

API

  • Login
  • Logout
  • isLogged

Usage

import { Twitter } from "@capacitor-community/twitter";
const twitter = new Twitter();

twitter
  .login()
  .then((r) => console.log(r)) // { authToken:string, authTokenSecret:string, userName:string, userID:string }
  .catch((err) => console.log(err));

twitter
  .isLogged()
  .then((r) => console.log(r)) // returns { in: boolean, out: boolean }
  .catch((err) => console.log(err));

twitter.logout();

iOS setup

  • ionic start my-cap-app --capacitor
  • cd my-cap-app
  • npm install —-save @capacitor-community/twitter
  • mkdir www && touch www/index.html
  • npx cap add ios
  • add the consumer keys at capacitor.config.json
{
 …
  "plugins": {
   "TwitterPlugin": {
      "consumerKey": "xxx",
      "consumerSecret": "yyy"
    }
  }
…
}
  • npx cap open ios
  • sign your app at xcode (general tab)
  • add a new url type at Xcode (info tab) and make sure the url scheme follows the format twitterkit-your_consumer_api_key (grab a key at twitter developer site)
  • also at twitter developer site, add a new callback url in the same format: twitterkit-your_consumer_api_key:// (with nothing behind it)

Then you should be set to go. Run ionic cap run ios --livereload to start the server and play it through xcode

Important Notice: every time you change a native code you may need to clean the cache (Product > Clean build folder) and then run the app again.

Android setup

  • ionic start my-cap-app --capacitor
  • cd my-cap-app
  • npm install —-save @capacitor-community/twitter
  • mkdir www && touch www/index.html
  • npx cap add android
  • add the consumer keys at capacitor.config.json
{
 …
  "plugins": {
   "TwitterPlugin": {
      "consumerKey": "xxx",
      "consumerSecret": "yyy"
    }
  }
…
}
  • at twitter developer site, add this callback url: twittersdk:// (with nothing behind it)
  • [extra step] in android case we need to tell Capacitor to initialise the plugin:

on your MainActivity.java file add import com.getcapacitor.community.twitter.TwitterPlugin; and then inside the init callback add(TwitterPlugin.class);

Now you should be set to go. Try ionic cap run android --livereload to start the server and play/debug it through Android Studio

Important Notice: every time you change a native code you may need to clean the cache (Build > Clean Project | Build > Rebuild Project) and then run the app again.

Example

  • https://github.com/capacitor-community/twitter/blob/master/example

License

MIT

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!