Giter VIP home page Giter VIP logo

glitch-api's Introduction

glitch-api

GitHub package.json dynamic CircleCI npm bundle size

A Node.js module that allows you to easily interact with the Glitch API

📖 Documentation Examples

Features

  • 99% coverage of the known Glitch API
  • Uses TypeScript that provides hints in editor, type checking, etc.
  • Supports WebSocket connection to the Glitch editor
  • Support for authorization
  • Only one dependence: node-fetch
  • Class abstraction
  • Works with both API versions
Warning: this module uses unstable API that hasn't been officially released yet. Described only world-open methods from this unofficial site and my researches

Installation

Node.js 8.0.0 or newer is required

NPM
npm i glitch-api -s

Example usage

// Require using ES6 syntax
import { Glitch } from 'glitch-api'

// Or using old fancy style
const { Glitch } = require('glitch-api')

// Init main class
const glitch = new Glitch({ token: 'xxx' })  // Put here your Glitch token
const { api } = glitch

// Get a user profile
api.users.get({ id: 1 }).then(user => console.log) // → User

Q&A

— How do I get Glitch token?

Paste the following code to the browser's console:

(JSON.parse(localStorage.getItem('cachedUser'))).persistentToken

— Why *api-method* is not implemented?

Because I'm also human and I might not have seen the recent changes in Glitch's API. Anyway, PRs are open for anyone :)

— The *api-method* is not working.

It could be that Glitch devs removed the support for that method. Or it's just a my fault. Open a new issue and describe what's happend.

Contribution

Feel free to open new Pull request or an issue!

Credits

Made by jarvis394 with ♥️

glitch-api's People

Contributors

jarvis394 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.