In this quick start tutorial, you will create a single-click app using Node.js, React, Next.js, and BigDesign.
To successfully complete this tutorial, you will need the following:
You will need a publicly accessible URL to connect the draft app to BigCommerce. To add network access while in the development phase, you can use ngrok, a free tool that lets you expose local servers like localhost:3000 to the public internet over secure tunnels.
You can obtain your authtoken by going to https://dashboard.ngrok.com/get-started/your-authtoken.
Next, create a draft app profile in the Developer Portal using the following steps:
https://{ngrok_url}/api/auth. For example, https://12345.ngrok.io/api/auth. You can get the ngrok_url from the terminal that is running ngrok http http://localhost:8080.https://{ngrok_url}/api/load.https://{ngrok_url}/api/uninstall.https://{ngrok_url}/api/remove_user.modify. To learn more about the available OAuth scopes, see OAuth scopes.Keep this tab open for the next step.
After registering the draft app, add its credentials and auth callback URL to your project’s environment variables file.
If deploying on Heroku, skip the .env setup. Instead, enter env variables in the Heroku App Dashboard under Settings > Config Vars.
Create a .env file in the root directory of your project.
Copy the contents of .env-sample to .env.
Replace the CLIENT_ID and CLIENT_SECRET with the app’s client ID and client secret from the Developer Portal.
Update the AUTH_CALLBACK with the ngrok_url. You can get the ngrok_url from the terminal that is running ngrok http 3000.
Enter a JSON Web Token (JWT) secret. To learn more about JWT, see the Internet Engineering Task Force documentation.
JWT key length & Generation
This will provide a random 32 character output in the terminal that you can use as your JWT key.
Ensure not to share this key publicly as it is used to sign and verify JWT tokens for your app.
DB_TYPE:CLEARDB_DATABASE_URL.In a separate terminal from ngrok, start the app’s dev environment.
Although you can use the ngrok npm package without creating an account, any unauthenticated tunnels you create will expire after two hours. For the best development experience, create a free ngrok account, find your ngrok authtoken, and add the authtoken to your global ngrok configuration.
Finally, install the draft app on any store registered to the same email as your Developer Portal account using the following steps:
Authorization Successful message./load callback./uninstall callback.Congrats! You’ve created and installed a BigCommerce draft app.
Interested in sharing or selling your app? Learn more about becoming a BigCommerce partner and getting your app approved.