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

insomnia-plugin-twitch-extension-barrycarlyon

v1.1.1

Published

This is a plugin for [insomnia](https://insomnia.rest) that will help with Twitch Extension Development by doing the JWT Generation for you. No more "expired" JWT's as one is generated at request time for you!

Downloads

1,034

Readme

insomnia-plugin-twitch-extension-barrycarlyon

This is a plugin for insomnia that will help with Twitch Extension Development by doing the JWT Generation for you. No more "expired" JWT's as one is generated at request time for you!

A sample Insomnia "Request Collection" is provided in this repository for easy import and getting started!

Install

Either:

  • Use this in a browser insomnia://plugins/install?name=insomnia-plugin-twitch-extension-barrycarlyon (GH markdown disallows this schema)
  • Open Insomnia, Click on the Cog Top Right, Click Plugins and use insomnia-plugin-twitch-extension-barrycarlyon as the Package to install
  • Find this plugin on the Insomnia Plugins list instead!

Collection Quick Start

  • Create
  • Import From
  • URL
  • Use: https://raw.githubusercontent.com/BarryCarlyon/insomnia-plugin-twitch-extension-barrycarlyon/main/request_collection/collection.json

This will create Twitch Extensions Insomnia Collection

Which will contain a Blank Twitch Environment To either clone of populate with your Extension Keys

Configuration

After installing this plugin.

Create an Environment using this JSON Format:

{
  "client_id": "",
  "extension_secret": "",
  "owner_id": "",
  "version": ""
}

A version isn't required, just make sure to specify a version as dictated by the Twitch Documentation for the relevant endpoints, either in the Query parameters or JSON body depending on the endpoint.

You can specify a version to make your environment more similar to a production .env

Please ensure that owner_id is expressed as a string otherwise the generated JWT's will not be valid.

This Plugin will not fix/cast to String for you, to ensure that you don't make the same mistake when moving to production code. So for example:

{
  "client_id": "MyExtensionClientID",
  "extension_secret": "bXlleHRlbnNpb25zZWNyZWN0YXNiYXNlNjQ=",
  "owner_id": "15185913",
  "version": "0.0.1"
}

Extension Secret should be the Base64 Encoded version directly copied from the Twitch Extension Dashboard, as the plugin will handle decoding.

Don't forget to set this environment as active to Insomnia for your Collection.

Usage

You will not need to define any headers for the requests. This Plugin will add the Client-ID and Authorization headers for you

You can also omit the following for each Endpoint this plugin supports

Get Extension Configuration Segment

You do not need to add a Query parameter for extension_id. This plugin will do that for you.

So just specify segment and broadcaster_id if needed

Set Extension Configuration Segment

You do not need to add a JSON Body parameter for extension_id. This plugin will do that for you.

The "content" of the Config Service needs to be a JSON Encoded string. But if you are "lazy" and specify an object instead, the plugin will auto JSON Encode the content for you.

For example

{
    "segment": "global",
    "content": {
        "foo": "bar"
    }
}

or

{
    "segment": "global",
    "content": "{\"foo\":\"bar\"}"
}

Will work fine. As the plugin will convert the former to the latter for you.

This makes reading the Insomnia JSON Panel a lot nicer and easier to format.

Set Extension Required Configuration

You do not need to add a JSON Body parameter for extension_id or extension_version. This plugin will do that for you.

So a JSON body of

{
    "broadcaster_id": "xxxyyy",
    "configuration_version": "zzzz"
}

Will work fine.

Send Extension PubSub Message

The "message" of the Send PubSub Message request needs to be JSON Encoded. But if you are "lazy" and specify an object, the plugin will auto JSON Encode the content for you.

For example

{
    "segment": "global",
    "content": {
        "foo": "bar"
    }
}

or

{
    "segment": "global",
    "content": "{\"foo\":\"bar\"}"
}

Send Extension Chat Message

The plugin will set the required body parameters of extension_id and extension_version for you. So a JSON body of

{
    "text": "words"
}

will do the job. Just don't forget the Query parameter of broadcaster_id.

You can override the Environment set extension_version by using a body parameter:

{
    "text": "words",
    "extension_version": "some_version"
}

Get Extensions

The plugin will set the required Query parameters of extension_id.

If there is no environment set version then this API will return the released version of the Extension, otherwise the optional Query parameter of extension_version is set from the environment.

You can override the environment by specifying a Query parameter of extension_version

Other Tools!

For a more "fully fledged" Twitch Extensions Tools Client, check out my "Twitch Extension Tools" Project