Hello everybody! Help me please. Can anyone have a Glitch API? Give a link to the documentation if available.
The Glitch API is not ready for public consumption yet so there are no official docs, but I am sure someone can help you out I’ve never used it myself
Eddie
Thank you the answer
There is simply a module that allows you to use the Glitch API. I checked it, but essentially nothing worked.
Yes, it does. If you know how to use it.
And why is that?
@khalby786, Honestly I do not know. I thought it did not work. After all, the Glitch API is not yet publicly available.
Make sure you have Git and npm installed.
Sorry, to clarify, it is available for you to use, it’s just not ready/designed for you to use it (e.g. public consumption)
Sorry if I confused you there.
Eddie
Hello @xyligan,
Can you please describe what’s gone wrong? Can you share screenshots or logs from the package examples?
Uff … I uninstalled the module already unfortunately …
Could you please remember what didn’t work with your VSC? Have you used a Glitch user’s token?
I can give only the sample code that I wrote.
const { Glitch } = require('glitch-api');
const glitch = new Glitch({ token: 'my token' });
const { api } = glitch;
if(cmd === `${prefix}project`) {
let messageArray = message.content.split(' ');
let cmd = messageArray[0];
let args = messageArray.slice(1);
api.projects.search(args[0]);
}
I received the token in the browser console by writing the following command:
(JSON.parse(localStorage.getItem('cachedUser'))).PersistentToken
Yep, searching is broken because Glitch now uses Algolia API. I’ll see what I can do here.
Also, .search
returns Promise, therefore you have to use .then
construction or async/await
.
I think you can use projects.get with project domain: https://glapi.ml/classes/projects#get
const project = await api.projects.get({ domain })