Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b2d14f3
deps
timbenniks Oct 20, 2025
50a4e2c
bump version to 0.0.6 in package.json
harshithad0703 Oct 27, 2025
7fc7b66
Merge pull request #32 from contentstack/chore/better-env-handling
harshithad0703 Oct 27, 2025
cefd619
chore: update dependencies and version to 0.0.7
harshithad0703 Dec 31, 2025
4af84a0
Merge pull request #43 from contentstack/fix/security-issues
cs-raj Jan 5, 2026
da3456b
lock-file updated
cs-raj Jan 9, 2026
bd35bd0
Merge pull request #46 from contentstack/fix/DX-3875
cs-raj Jan 9, 2026
58b220c
chore: update @contentstack/delivery-sdk to 4.10.6
harshithad0703 Jan 13, 2026
8830b02
snyk fix
harshithad0703 Jan 13, 2026
0645d55
Merge pull request #50 from contentstack/chore/upgrade-delivery-sdk
harshithad0703 Jan 13, 2026
49b815e
snyk fix
harshithad0703 Feb 6, 2026
54bb624
Merge pull request #56 from contentstack/chore/security-fixes
cs-raj Feb 9, 2026
55b6ce5
Update sca-scan.yml
dhavaljain999 Mar 3, 2026
1dda8c8
chore: upgraded contentstack-delivery-sdk to v5
cs-raj Mar 20, 2026
6077e23
Merge pull request #72 from contentstack/chore/upgrade-contentstack-d…
cs-raj Mar 20, 2026
7850e2b
chore: upgrade Angular v20 to v21 and update production dependencies
timbenniks Mar 23, 2026
a41797c
version bump
harshithad0703 Mar 23, 2026
9b7ab28
Merge pull request #73 from contentstack/chore/deps-update-2026-03-23
harshithad0703 Mar 26, 2026
7c8bf53
chore: dependency update
cs-raj Apr 17, 2026
5fa6a50
Merge pull request #78 from contentstack/fix/sre
cs-raj Apr 17, 2026
8369f71
chore: dependency update
cs-raj May 6, 2026
f06336c
Merge pull request #79 from contentstack/fix/snyk2
cs-raj May 6, 2026
9c4b842
chore: dependency update
cs-raj May 27, 2026
3ebc24b
Merge pull request #80 from contentstack/fix/dependency
cs-raj May 27, 2026
6c2e225
enhc: replace @timbenniks/contentstack-endpoints with @contentstack/u…
cs-raj Jun 17, 2026
3f59fbd
added generate-env
cs-raj Jun 17, 2026
f0f29c6
Merge pull request #81 from contentstack/enhc/DX-8580
cs-raj Jun 17, 2026
28f200b
updated angular version
cs-raj Jun 17, 2026
f9de4f1
Merge branch 'main' into enhc/DX-8580
cs-raj Jun 17, 2026
6ff6fb8
Merge pull request #82 from contentstack/enhc/DX-8580
cs-raj Jun 17, 2026
97a8900
issues-jira.yml
Aravind-Kumar-cstk Jun 19, 2026
233b878
changed region from us to NA
cs-raj Jun 19, 2026
2f293e2
Merge branch 'main' into enhc/DX-8580
cs-raj Jun 19, 2026
f4a2b9a
Merge pull request #83 from contentstack/enhc/DX-8580
cs-raj Jun 19, 2026
d5069a7
chore: add Linux optional dependencies for Rollup and LightningCSS
cs-raj Jun 19, 2026
aac61c1
Merge branch 'main' into enhc/DX-8580
cs-raj Jun 19, 2026
64d9236
Merge pull request #84 from contentstack/enhc/DX-8580
cs-raj Jun 19, 2026
e26798c
Delete issues-jira.yml
Aravind-Kumar-cstk Jun 30, 2026
38086a7
fix snyk issues
harshithad0703 Jul 29, 2026
25ae2bc
snyk fixes
harshithad0703 Jul 29, 2026
fd7302a
Merge pull request #98 from contentstack/fix/snyk-issues
harshithad0703 Jul 30, 2026
e7bdd25
sca-scan.yml
Aravind-Kumar-cstk Aug 2, 2026
0d53a42
fix: resolve Snyk security issues
harshithad0703 Aug 5, 2026
0d94ace
Merge pull request #105 from contentstack/fix/snyk-issues-10-8
netrajpatel Aug 5, 2026
78835ef
fix: bump 18 deps and add 8 overrides to resolve Snyk vulnerabilities
cs-raj Aug 9, 2026
78d950b
Merge pull request #115 from contentstack/fix/snyk-patch-deps-20260809
cs-raj Aug 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ NG_APP_CONTENTSTACK_API_KEY=your_api_key_here
NG_APP_CONTENTSTACK_DELIVERY_TOKEN=your_delivery_token_here
NG_APP_CONTENTSTACK_PREVIEW_TOKEN=your_preview_token_here
NG_APP_CONTENTSTACK_ENVIRONMENT=preview
NG_APP_CONTENTSTACK_REGION=EU
NG_APP_CONTENTSTACK_REGION=EU # Options: NA, EU, AU, AZURE-NA, AZURE-EU, GCP-NA, GCP-EU
NG_APP_CONTENTSTACK_PREVIEW=true
31 changes: 0 additions & 31 deletions .github/workflows/issues-jira.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
jobs:
security-sca:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
Expand All @@ -13,3 +16,6 @@ jobs:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --fail-on=all
json: true
continue-on-error: true
- uses: contentstack/sca-policy@main
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Contentstack
Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,43 @@ Go to `http://localhost:4200/`.
Go to Entries and select the only entry in the list.
In the sidebar, click on the live preview icon.
Or, click on visual experience in the sidebar.

## Regions and endpoint configuration

Set `NG_APP_CONTENTSTACK_REGION` to the value matching your Contentstack account region:

| Region | Value |
|---|---|
| North America (default) | `NA` or `US` |
| Europe | `EU` |
| Australia | `AU` |
| Azure North America | `AZURE-NA` |
| Azure Europe | `AZURE-EU` |
| GCP North America | `GCP-NA` |
| GCP Europe | `GCP-EU` |

The app uses `getContentstackEndpoint` from `@contentstack/utils` to resolve the correct API hostnames for your region automatically (via `generate-env.js` at build time). The following endpoint keys are resolved:

| Key | NA value |
|---|---|
| `contentDelivery` | `cdn.contentstack.io` |
| `preview` | `rest-preview.contentstack.com` |
| `application` | `app.contentstack.com` |
| `graphqlDelivery` | `graphql.contentstack.com` |
| `graphqlPreview` | `graphql-preview.contentstack.com` |
| `images` | `images.contentstack.io` |
| `assets` | `assets.contentstack.io` |
| `contentManagement` | `api.contentstack.io` |
| `auth` | `auth.contentstack.io` |

### Custom or dedicated environments

If you are on a dedicated or private cloud Contentstack instance, you can override the resolved endpoints via environment variables:

```
NG_APP_CONTENTSTACK_CONTENT_DELIVERY=your-custom-cdn.example.com
NG_APP_CONTENTSTACK_PREVIEW_HOST=your-custom-preview.example.com
NG_APP_CONTENTSTACK_CONTENT_APPLICATION=your-custom-app.example.com
```

These override values take precedence over the region-resolved endpoints.
42 changes: 10 additions & 32 deletions generate-env.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env node

const {
getContentstackEndpoints,
getRegionForString,
} = require("@timbenniks/contentstack-endpoints");
const { getContentstackEndpoint } = require("@contentstack/utils");

const fs = require("fs");
const path = require("path");
Expand All @@ -30,8 +27,7 @@ if (fs.existsSync(envPath)) {
});
}

const region = getRegionForString(envVars.NG_APP_CONTENTSTACK_REGION);
const endpoints = getContentstackEndpoints(region, true);
const endpoints = getContentstackEndpoint(envVars.NG_APP_CONTENTSTACK_REGION || 'NA', '', true);

// Generate environment.ts content
const environmentContent = `export const environment = {
Expand All @@ -41,21 +37,12 @@ const environmentContent = `export const environment = {
deliveryToken: '${envVars.NG_APP_CONTENTSTACK_DELIVERY_TOKEN || ""}',
previewToken: '${envVars.NG_APP_CONTENTSTACK_PREVIEW_TOKEN || ""}',
environment: '${envVars.NG_APP_CONTENTSTACK_ENVIRONMENT || "preview"}',
region: '${region ? region : envVars.NG_APP_CONTENTSTACK_REGION}',
region: '${envVars.NG_APP_CONTENTSTACK_REGION || "NA"}',
preview: ${envVars.NG_APP_CONTENTSTACK_PREVIEW === "true"},

contentDelivery: '${
envVars.NG_APP_CONTENTSTACK_CONTENT_DELIVERY ||
(endpoints && endpoints.contentDelivery)
}',
previewHost: '${
envVars.NG_APP_CONTENTSTACK_PREVIEW_HOST ||
(endpoints && endpoints.preview)
}',
applicationHost: '${
envVars.NG_APP_CONTENTSTACK_CONTENT_APPLICATION ||
(endpoints && endpoints.application)
}'
contentDelivery: '${envVars.NG_APP_CONTENTSTACK_CONTENT_DELIVERY || endpoints.contentDelivery}',
previewHost: '${envVars.NG_APP_CONTENTSTACK_PREVIEW_HOST || endpoints.preview}',
applicationHost: '${envVars.NG_APP_CONTENTSTACK_CONTENT_APPLICATION || endpoints.application}'
}
};
`;
Expand All @@ -68,21 +55,12 @@ const environmentProdContent = `export const environment = {
deliveryToken: '${envVars.NG_APP_CONTENTSTACK_DELIVERY_TOKEN || ""}',
previewToken: '${envVars.NG_APP_CONTENTSTACK_PREVIEW_TOKEN || ""}',
environment: '${envVars.NG_APP_CONTENTSTACK_ENVIRONMENT || "preview"}',
region: '${region ? region : envVars.NG_APP_CONTENTSTACK_REGION}',
region: '${envVars.NG_APP_CONTENTSTACK_REGION || "NA"}',
preview: ${envVars.NG_APP_CONTENTSTACK_PREVIEW === "true"},

contentDelivery: '${
envVars.NG_APP_CONTENTSTACK_CONTENT_DELIVERY ||
(endpoints && endpoints.contentDelivery)
}',
previewHost: '${
envVars.NG_APP_CONTENTSTACK_PREVIEW_HOST ||
(endpoints && endpoints.preview)
}',
applicationHost: '${
envVars.NG_APP_CONTENTSTACK_CONTENT_APPLICATION ||
(endpoints && endpoints.application)
}'
contentDelivery: '${envVars.NG_APP_CONTENTSTACK_CONTENT_DELIVERY || endpoints.contentDelivery}',
previewHost: '${envVars.NG_APP_CONTENTSTACK_PREVIEW_HOST || endpoints.preview}',
applicationHost: '${envVars.NG_APP_CONTENTSTACK_CONTENT_APPLICATION || endpoints.application}'

}
};
Expand Down
Loading
Loading