Custom format for API Key

I need my API keys to be a UUID v4 (the software that it interfaces with requires the keys to be formatted that way) - how can I do this with the API key plugin?
Solution:
Solution: ```ts plugins: [ apiKey({ customKeyGenerator: async () => {...
Jump to solution
1 Reply
Solution
!skyfall
!skyfall5d ago
Solution:
plugins: [
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
}),
],
plugins: [
apiKey({
customKeyGenerator: async () => {
return crypto.randomUUID();
},
}),
],

Did you find this page helpful?