Skip to content

Commit

Permalink
Merge pull request #10 from contentstack/staging
Browse files Browse the repository at this point in the history
updating env config
  • Loading branch information
Amitkanswal authored Dec 17, 2021
2 parents ca0e246 + b11e3f5 commit 08db351
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#create environment file name as .env.development.local,.env.production.local
#and place following configuration data.

API_KEY=YOUR_API_KEY
DELIVERY_TOKEN=YOUR_DELIVERY_TOKEN
ENVIRONMENT=YOUR_PUBLISHING_ENVIRONMENT
CONTENTSTACK_API_KEY=YOUR_API_KEY
CONTENTSTACK_DELIVERY_TOKEN=YOUR_DELIVERY_TOKEN
CONTENTSTACK_ENVIRONMENT=YOUR_PUBLISHING_ENVIRONMENT

# For setting region add REGION=(Optional for US region) Eg- eu
# For setting custom host add CUSTOM_HOST=(Optional)
# For setting region add CONTENTSTACK_REGION=(Optional for US region) Eg- eu
# For setting custom host add CONTENTSTACK_CUSTOM_HOST=(Optional)
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ yarn-error.log*

# vercel
.vercel
yarn.lock
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "contentstack-nextjs-starter-app",
"description": "A starter app for Contentstack and Nextjs",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"author": "Contentstack",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions sdk-plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const contentstack = require("contentstack");

const Stack = contentstack.Stack({
api_key: process.env.API_KEY,
delivery_token: process.env.DELIVERY_TOKEN,
environment: process.env.ENVIRONMENT,
region: process.env.REGION ? process.env.REGION : "us",
api_key: process.env.CONTENTSTACK_API_KEY,
delivery_token: process.env.CONTENTSTACK_DELIVERY_TOKEN,
environment: process.env.CONTENTSTACK_ENVIRONMENT,
region: process.env.CONTENTSTACK_REGION ? process.env.CONTENTSTACK_REGION : "us",
});

if (process.env.CUSTOM_HOST) {
Stack.setHost(process.env.CUSTOM_HOST);
if (process.env.CONTENTSTACK_CUSTOM_HOST) {
Stack.setHost(process.env.CONTENTSTACK_CUSTOM_HOST);
}
export default {
/**
Expand Down

0 comments on commit 08db351

Please sign in to comment.