How to fix MemberStack connection issues with valid API keys in Next.js Stripe integration?
Hello team, please I am a developer working on a Nextjs project where I want to use MemberStack to automate my stripe payment package but having issues with Memberstack connection. The users are accepted by db but memberstack is not accepting the connection. It is saying, submit a valid key and I have used the correct keys. I don't know who can help you solve this issue. Thanks
Comments
4 comments
What method of which package (admin or Dom) are you trying to use?
I created an unofficial Nextjs starter template, that you can use as an example on how to connect with Memberstack https://github.com/raqlo/template-nextjs-memberstack
Thanks, I am using the admin SDK because I just want the client to replace my .env values with his own .env without changing any of the codes
Thanks for helping me out but the issue I am getting is the key is an invalid API key
The admin package can be used using via the Node package or the REST package. You must pass a secret key to be able to connect via the admin, it can be found in the dev tools. If you're using test mode your secret key will start as
sk_sb_...and if you're building for production the prefix will change to onlysk_...If you're using the REST package you need to send the api key via headers
If you're using the NodeJS package you have to first initialize the singleton and pass the secret key before using it in any of your services
Without more context or code preview I am unable to provide a more accurate solution to your problem. Hopefully this helps.
Make sure to use the keys first as plain text to initially test the connection and if all works, then test your dotenv configuration to make sure the environments variable are setup correctly
Yeah, I will try it but you have done a great job in putting me through. Thanks for the assistance.
Please sign in to leave a comment.