Skip to content
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

feat: adds Unkey for API key generation #27

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

Conversation

domeccleston
Copy link

Description

1-minute overview Loom

This replaces custom API key generation logic with the Unkey SDK. It adds a custom prefix for keys and fast rate limiting. Also updates the docs.

What type of PR is this? (check all applicable)

  • 💡 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

None

Mobile & Desktop Screenshots/Recordings

ding

Steps to QA

  1. Visit the dashboard
  2. Create an API key
  3. Notice the custom prefix

Added to documentation?

  • 📜 README.md
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

No

[optional] What gif best describes this PR or how it makes you feel?

giphy

Copy link

vercel bot commented May 15, 2024

@domeccleston is attempting to deploy a commit to the meglerhagen's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Codehagen Codehagen self-requested a review May 15, 2024 15:06
@Codehagen Codehagen added this to the Alpha 0.1 milestone May 15, 2024
Copy link
Owner

@Codehagen Codehagen left a comment

Choose a reason for hiding this comment

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

See comments for generate-api-key.ts ✨

Copy link
Owner

Choose a reason for hiding this comment

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

I got some errors for this component:

Screenshot 2024-05-16

It looks like it has something to do with this this
Screenshot 2024-05-16

Could you look into it?

Copy link
Author

Choose a reason for hiding this comment

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

Hey @Codehagen, I've resolved the type errors here by changing the error handling in the file

Copy link
Author

Choose a reason for hiding this comment

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

i'm not sure why those weren't showing for me previously

const {
result: { key: apiKey },
} = await unkey.keys.create({
const { result } = await unkey.keys.create({
apiId: "api_3PkKmeLT2WeGsbRUVWH1YAZJK886",

Choose a reason for hiding this comment

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

I think the problem is that this is @domeccleston's hardcoded apiID, @Codehagen needs to use their own from the unkey dashboard.

Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dingify ❌ Failed (Inspect) May 28, 2024 6:34pm

@Codehagen
Copy link
Owner

Merging this within the weekend 👍 @chronark

@Codehagen
Copy link
Owner

Just merged main into this to resolve some merge conflicts. Still getting an error. Have not read the documentation, but was wondering if you guys know? @chronark @domeccleston

Took the API from the project into this
Screenshot 2024-05-28@2x
The last picture is just to show the payload that is being sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants