import Salamoonder, { TwitchIntegrity } from "salamoonder";
const api = new Salamoonder(process.env.SALAMOONDER_API_KEY);
try {
api.generateIntegrity().then((response: TwitchIntegrity) => {
console.log(response.token);
});
} catch (error) {
console.log(error);
}
By default you are supporting me through the usage of my app id. This can be disabled by simply adding false
as a second parameter when initiating the salamoonder class.
const api = new Salamoonder(process.env.SALAMOONDER_API_KEY, false);
api.getBalance().then((bal: number) => {
console.log(bal);
});
number;
Solves a kasada captcha for a given site.
- site: Site to solve the captcha for
api.solveCaptcha(TaskPjsFile.TWITCH).then((response: getTaskResult) => {
console.log(response);
});
{
errorId: number;
solution: {
type: string;
"user-agent": string;
"x-kpsdk-cd": string;
"x-kpsdk-cr": string;
"x-kpsdk-ct": string;
"x-kpsdk-r": string;
"x-kpsdk-st": string;
};
status: "ready" | "pending";
}
Registers a new Twitch account.
- email: Email address for the account
api.registerTwitchAccount("test@test.tk").then((response: getTaskResult) => {
console.log(response);
});
{
errorId: number;
solution: {
type: string;
access_token: string;
password: string;
username: string;
}
status: "ready" | "pending";
}
Checks the integrity of a Integrity Token.
- token: Integrity Token to check
api.checkTwitchIntegrity("token").then((response: getTaskResult) => {
console.log(response);
});
{
errorId: number;
solution: {
type: string;
client_id: string;
client_ip: string;
device_id: string;
exp: string;
iat: string;
is_bad_bot: string;
iss: string;
nbf: string;
user_id: string;
}
status: "ready" | "pending";
}
Scrapes Twitch for meta data
api.scrapeTwitch().then((response: TwitchScraperSolution) => {
console.log(response);
});
{
errorId: number;
solution: {
biography: string;
profile_picture: string;
username: string;
}
status: "ready" | "pending";
}
Generates an Integrity token.
Both Salamoonder versions require a proxy with the format user:password@host:port
Generation via Salamoonder, with token
Generation via Salamoonder, no token
Generation locally, optionally token & proxy
Generate Passport Integrity Tokens, optionally proxy
- type: Generation Method
- data: Data for each method
api
.generateIntegrity(IntegrityGenerateType.API_PUBLIC, {
proxy: "test:123@test:3000",
access_token: "jneapaw1pr0ob83fievedqpi1jqzb4",
})
.then((response: TwitchIntegrity) => {
console.log(response);
});
{
clientId: string;
token: string;
sessionId?: string;
userAgent: string;
deviceId: string;
}