[GH-ISSUE #1104] JWT #19311

Closed
opened 2026-06-10 16:58:19 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @Riders004 on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/1104

problem description

How to get JWT tokens

https://github.com/imputnet/cobalt/blob/main/api/src/config.js

Line 39, 40, 41, 42

your instance configuration


Originally created by @Riders004 on GitHub (Feb 12, 2025). Original GitHub issue: https://github.com/imputnet/cobalt/issues/1104 ### problem description How to get JWT tokens https://github.com/imputnet/cobalt/blob/main/api/src/config.js Line 39, 40, 41, 42 ### your instance configuration ```shell ```
GiteaMirror added the instance hosting help label 2026-06-10 16:58:19 -05:00
Author
Owner
<!-- gh-comment-id:2652695548 --> @wukko commented on GitHub (Feb 12, 2025): https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md https://github.com/imputnet/cobalt/blob/main/docs/protect-an-instance.md
Author
Owner

@Riders004 commented on GitHub (Feb 12, 2025):

https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md

https://github.com/imputnet/cobalt/blob/main/docs/protect-an-instance.md

https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md#run-cobalt-api-outside-of-docker-useful-for-local-development

See number 5 it's says

add needed environment variables to .env file. only API_URL is required to run cobalt.

But in https://github.com/imputnet/cobalt/blob/main/api/src/config.js line 42

jwtSecret: process.env.JWT_SECRET, there is no value

<!-- gh-comment-id:2652698685 --> @Riders004 commented on GitHub (Feb 12, 2025): > https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md > > https://github.com/imputnet/cobalt/blob/main/docs/protect-an-instance.md https://github.com/imputnet/cobalt/blob/main/docs/run-an-instance.md#run-cobalt-api-outside-of-docker-useful-for-local-development See number 5 it's says add needed environment variables to .env file. only API_URL is required to run cobalt. But in https://github.com/imputnet/cobalt/blob/main/api/src/config.js line 42 jwtSecret: process.env.JWT_SECRET, there is no value
Author
Owner

@wukko commented on GitHub (Feb 12, 2025):

jwt secret isn’t required to run an instance. for protection measures, such as turnstile + jwt, read the second document

<!-- gh-comment-id:2652700802 --> @wukko commented on GitHub (Feb 12, 2025): jwt secret isn’t *required* to run an instance. for protection measures, such as turnstile + jwt, read the second document
Author
Owner

@Riders004 commented on GitHub (Feb 12, 2025):

jwt secret isn’t required to run an instance. for protection measures, such as turnstile + jwt, read the second document

can I use api.cobalt.tools or cobalt.tools in nodejs project to download audio from youtube ?

<!-- gh-comment-id:2652705745 --> @Riders004 commented on GitHub (Feb 12, 2025): > jwt secret isn’t _required_ to run an instance. for protection measures, such as turnstile + jwt, read the second document can I use api.cobalt.tools or cobalt.tools in nodejs project to download audio from youtube ?
Author
Owner

@wukko commented on GitHub (Feb 12, 2025):

no, you have to host your own api instance

<!-- gh-comment-id:2652708452 --> @wukko commented on GitHub (Feb 12, 2025): no, you have to host your own api instance
Author
Owner

@Riders004 commented on GitHub (Feb 12, 2025):

no, you have to host your own api instance

Ok

you can generate a random secret with pnpm -r token:jwt or use any other that you like
In 2md doc

Where I want run pnpm -r token:jwt in my phone or pc or where I'm hosting it ?

I run it on termux and get a result

e in 4.84s.
.../0/botto $ pnpm -r token:jwt Scope: all 15 projects
 ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT  None of the packages has a "token:jwt" script
.../0/botto $

<!-- gh-comment-id:2652710388 --> @Riders004 commented on GitHub (Feb 12, 2025): > no, you have to host your own api instance Ok you can generate a random secret with pnpm -r token:jwt or use any other that you like In 2md doc Where I want run pnpm -r token:jwt in my phone or pc or where I'm hosting it ? I run it on termux and get a result e in 4.84s. .../0/botto $ pnpm -r token:jwt Scope: all 15 projects  ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT  None of the packages has a "token:jwt" script .../0/botto $
Author
Owner

@wukko commented on GitHub (Feb 12, 2025):

you have to run it in cobalt’s api directory, aka where the script is

<!-- gh-comment-id:2652714309 --> @wukko commented on GitHub (Feb 12, 2025): you have to run it in cobalt’s api directory, aka where the script is
Author
Owner

@Riders004 commented on GitHub (Feb 12, 2025):

you have to run it in cobalt’s api directory, aka where the script is

It's give me but it's saying invalid token

Image

@wukko

<!-- gh-comment-id:2652716295 --> @Riders004 commented on GitHub (Feb 12, 2025): you have to run it in cobalt’s api directory, aka where the script is It's give me but it's saying invalid token ![Image](https://github.com/user-attachments/assets/5001cf91-fb30-4fa1-af6f-31b37cbd564c) @wukko
Sign in to join this conversation.