Skip to content

docs: added JWT_SECRET Secret Generator block for our Button !! #2959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

0xTaneja
Copy link
Contributor

Description

Fixes #2956"

Adds an in-page "Secret Generator” block to the Env Vars docs. The new component shows JWT_SECRET= in a code block, generates a secure 64-char value, copies it to the clipboard, and resets after a few seconds—making it easy for readers to grab a valid secret without leaving the page. Also removed the old unused button component.

Future Improvements which we can consider :-
I made the component such that it accepts a varName prop, so we can easily add generators for other secrets (OAuth client secret, etc.) by reusing the same block.

Select what type of change this PR introduces:

  1. Just code/docs improvement (no functional change).
  2. Bug fix (non-breaking change which fixes an issue).
  3. New feature (non-breaking change which adds functionality).
  4. Breaking change (fix or feature that would cause existing functionality to not work as expected).

@0xTaneja
Copy link
Contributor Author

2025-07-15.04-23-14.mp4

Copy link
Member

@cprecioso cprecioso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice (and fast) work! I'd like to propose a design change though. In order not to break the flow of our docs too much, it'd be better if this was just a single button that worked inline, so there'd be no need to add a section for it. Here's a sketch of how I see it working:
image
You can copy-paste the svg code for the icons at e.g. Radix Icons

Some more things:

  • No need to have the name of the variable in the output
  • I am impressed by the feature to clear out the secrets after 8s! However, this string is not so sensitive, so that feature is not necessary, it can be a bit annoying if people forget to copy it.
  • I also wouldn't auto-copy the secret, we might erase something the user had in their clipboard! Providing a button for copying it is nice though.

And finally, some quick style to-dos:

  • When you're done with the files, go to the repo root and run npm i && npm run prettier:format so the coding style is automatically applied
  • Also, I'll ask you to convert the inline styles to tailwind or to css modules

@0xTaneja
Copy link
Contributor Author

@cprecioso perfect i will work on those changes then , for having a section, i just took inspiration from your better auth link and tried to work about how they do !!

@0xTaneja
Copy link
Contributor Author

0xTaneja commented Jul 16, 2025

2025-07-16.20-55-15.mp4

@cprecioso did it inline , i feel i could work on button styling more and designing it more perfect , but yeah a feedback from our design engineer would be better in this case, i guess its frank right our design engineer ?? don't know i am happy to work around if needed. @cprecioso review it when you get time !!

@0xTaneja 0xTaneja requested a review from cprecioso July 17, 2025 13:28
@cprecioso
Copy link
Member

Hi @0xTaneja this is on my radar, I might take couple working days to review, but I haven't forgotten!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a secret generator button for our docs
2 participants