How Can I Find Glitch API Project ID And Token

I want to use the Glitch API system but the system wants “Token” and “Project ID”. Where can I find this data?

this is the example code:

const Glitch = require("glitch-api");
const glitchClient = new Glitch.Glitch({ token: "TOKEN" });
const glitchApi = glitchClient.api

console.log(glitchClient.token)

glitchApi.projects.remix({ id: "PROJECT_ID" }).then(project => {
  console.log(project.invite)
})

thanks!

This API was made by @jarvis394, am I right?

you’re right, but anyone can know about it :slight_smile:

I’m not sure if there is a token and project ID, unless someone else knows… :thinking:

Is this of any use:

glitch.token ⇒ string

Returns user token

Kind : instance property of Glitch

I found this in the API docs!

This function retrieving data from your code which means It will return “TOKEN” from the code “const glitch Client = new Glitch.Glitch ({token:” TOKEN “});”

what do we need to write in this { token: “TOKEN” } data

It is used to retrieve private projects from the projects you have access to.

1 Like

Hey @jarvis394

That sounds good but where can we find this data

thanks! :3

Which data you mean? The token itself? Then, you can get it in the editor’s page:

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