@timbenniks/contentstack-platform-app-scaffold 0.1.0 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/commands/scaffold.d.ts +0 -1
  2. package/dist/commands/scaffold.d.ts.map +1 -1
  3. package/dist/commands/scaffold.js +0 -5
  4. package/dist/commands/scaffold.js.map +1 -1
  5. package/dist/services/prompts.d.ts.map +1 -1
  6. package/dist/services/prompts.js +0 -1
  7. package/dist/services/prompts.js.map +1 -1
  8. package/dist/services/scaffold.d.ts.map +1 -1
  9. package/dist/services/scaffold.js +68 -19
  10. package/dist/services/scaffold.js.map +1 -1
  11. package/dist/types.d.ts +0 -3
  12. package/dist/types.d.ts.map +1 -1
  13. package/dist/types.js.map +1 -1
  14. package/oclif.manifest.json +0 -6
  15. package/package.json +6 -2
  16. package/templates/nextjs/.env.example.hbs +31 -4
  17. package/templates/nextjs/app/api/auth/[...nextauth]/route.ts.hbs +1 -0
  18. package/templates/nextjs/app/api/brandkit/[...path]/route.ts.hbs +7 -18
  19. package/templates/nextjs/app/api/cma/[...path]/route.ts.hbs +7 -18
  20. package/templates/nextjs/app/api/launch/[...path]/route.ts.hbs +7 -18
  21. package/templates/nextjs/app/assets/page.tsx.hbs +27 -12
  22. package/templates/nextjs/app/brandkit/page.tsx.hbs +32 -19
  23. package/templates/nextjs/app/entries/page.tsx.hbs +29 -13
  24. package/templates/nextjs/app/globals.css.hbs +98 -0
  25. package/templates/nextjs/app/launch/page.tsx.hbs +32 -19
  26. package/templates/nextjs/app/layout.tsx.hbs +18 -3
  27. package/templates/nextjs/app/page.tsx.hbs +142 -38
  28. package/templates/nextjs/app/providers.tsx.hbs +13 -1
  29. package/templates/nextjs/lib/auth.ts.hbs +48 -10
  30. package/templates/nextjs/manifest.json +3 -4
  31. package/templates/nextjs/next.config.ts +7 -0
  32. package/templates/nextjs/types/next-auth.d.ts.hbs +8 -0
  33. package/templates/nextjs/next.config.js +0 -4
  34. package/templates/nextjs/package.json.hbs +0 -24
  35. package/templates/nextjs/tsconfig.json +0 -21
@@ -11,7 +11,6 @@ export default class Scaffold extends Command {
11
11
  features: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  scopes: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
13
  "package-manager": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
- "no-git": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
14
  "no-install": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
15
  };
17
16
  run(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/commands/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAoBlD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,MAAM,CAAC,WAAW,SAAuD;IAEzE,MAAM,CAAC,QAAQ,WAId;IAED,MAAM,CAAC,IAAI;;MAKV;IAED,MAAM,CAAC,KAAK;;;;;;;;MA2BX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsB3B"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/commands/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAoBlD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,MAAM,CAAC,WAAW,SAAuD;IAEzE,MAAM,CAAC,QAAQ,WAId;IAED,MAAM,CAAC,IAAI;;MAKV;IAED,MAAM,CAAC,KAAK;;;;;;;MAuBX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB3B"}
@@ -48,10 +48,6 @@ class Scaffold extends core_1.Command {
48
48
  description: `Package manager (${types_1.VALID_PACKAGE_MANAGERS.join("|")})`,
49
49
  options: types_1.VALID_PACKAGE_MANAGERS,
50
50
  }),
51
- "no-git": core_1.Flags.boolean({
52
- description: "Skip git initialization",
53
- default: false,
54
- }),
55
51
  "no-install": core_1.Flags.boolean({
56
52
  description: "Skip dependency installation",
57
53
  default: false,
@@ -66,7 +62,6 @@ class Scaffold extends core_1.Command {
66
62
  features: flags.features ? parseFeatures(flags.features) : undefined,
67
63
  scopes: flags.scopes ? parseScopes(flags.scopes) : undefined,
68
64
  packageManager: flags["package-manager"],
69
- git: !flags["no-git"],
70
65
  install: !flags["no-install"],
71
66
  };
72
67
  const resolvedOptions = await (0, prompts_1.runPrompts)(cliOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/commands/scaffold.ts"],"names":[],"mappings":";;AAAA,sCAAkD;AAClD,iDAAgD;AAChD,mDAA+C;AAE/C,oCAAkG;AAElG,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;IACpE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,sBAAc,CAAC,QAAQ,CAAC,CAAY,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,aAAa,sBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAChF,CAAC;IACH,CAAC;IACD,OAAO,QAAqB,CAAA;AAC9B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,C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AK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAA;YAC7E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;;AA7DH,2BA8DC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/services/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAKV,eAAe,EAChB,MAAM,UAAU,CAAA;AAyCjB,wBAAsB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CA0FjF"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/services/prompts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAKV,eAAe,EAChB,MAAM,UAAU,CAAA;AAyCjB,wBAAsB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC,CAyFjF"}
@@ -147,7 +147,6 @@ async function runPrompts(cliOptions) {
147
147
  features: features,
148
148
  scopes,
149
149
  packageManager: packageManager,
150
- git: cliOptions.git,
151
150
  install: cliOptions.install,
152
151
  };
153
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/services/prompts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,gCA0FC;AA3ID,kDAAmC;AASnC,8DAA+D;AAE/D,MAAM,aAAa,GAA2B;IAC5C,EAAE,EAAE,oBAAoB;IACxB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,gBAAgB;IACpB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,QAAQ;CACnB,CAAA;AAED,MAAM,cAAc,GAA4B;IAC9C,GAAG,EAAE,sCAAsC;IAC3C,KAAK,EAAE,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AE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAE/C,OAAO;QACL,WAAW,EAAE,WAAqB;QAClC,SAAS,EAAE,SAAsB;QACjC,MAAM,EAAE,MAAgB;QACxB,QAAQ,EAAE,QAAqB;QAC/B,MAAM;QACN,cAAc,EAAE,cAAgC;QAChD,OAAO,EAAE,UAAU,CAAC,OAAO;KAC5B,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/services/scaffold.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,UAAU,CAAA;AA6BhE,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DtE"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/services/scaffold.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAkB,eAAe,EAAmB,MAAM,UAAU,CAAA;AAoDhF,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6FtE"}
@@ -37,12 +37,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.scaffold = scaffold;
40
+ const node_child_process_1 = require("node:child_process");
40
41
  const node_fs_1 = require("node:fs");
41
42
  const node_path_1 = require("node:path");
42
43
  const p = __importStar(require("@clack/prompts"));
43
44
  const picocolors_1 = __importDefault(require("picocolors"));
44
- const package_json_1 = __importDefault(require("../../package.json"));
45
- const git_1 = require("../utils/git");
46
45
  const package_manager_1 = require("../utils/package-manager");
47
46
  const template_engine_1 = require("../utils/template-engine");
48
47
  /** Resolve the path to a framework template directory */
@@ -62,41 +61,91 @@ function buildContext(options) {
62
61
  brandkit: options.features.includes("brandkit"),
63
62
  },
64
63
  scopes: options.scopes,
65
- sdkVersion: package_json_1.default.version,
66
64
  };
67
65
  }
66
+ /** Get the --use-<pm> flag for create-next-app */
67
+ function getPackageManagerFlag(pm) {
68
+ switch (pm) {
69
+ case "pnpm":
70
+ return "--use-pnpm";
71
+ case "yarn":
72
+ return "--use-yarn";
73
+ case "npm":
74
+ return "--use-npm";
75
+ }
76
+ }
77
+ /** Run a shell command, throwing on failure */
78
+ function run(command, cwd) {
79
+ (0, node_child_process_1.execSync)(command, { cwd, stdio: "pipe", timeout: 120_000 });
80
+ }
81
+ /** Add dependencies to an existing package.json */
82
+ function addDependencies(projectDir, deps) {
83
+ const pkgPath = (0, node_path_1.resolve)(projectDir, "package.json");
84
+ const pkg = JSON.parse((0, node_fs_1.readFileSync)(pkgPath, "utf-8"));
85
+ pkg.dependencies = { ...pkg.dependencies, ...deps };
86
+ (0, node_fs_1.writeFileSync)(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf-8");
87
+ }
68
88
  async function scaffold(options) {
69
89
  const projectDir = (0, node_path_1.resolve)(process.cwd(), options.projectName);
70
90
  if ((0, node_fs_1.existsSync)(projectDir)) {
71
91
  p.log.error(`Directory "${options.projectName}" already exists.`);
72
92
  throw new Error(`Directory "${options.projectName}" already exists.`);
73
93
  }
74
- (0, node_fs_1.mkdirSync)(projectDir, { recursive: true });
94
+ const pmFlag = getPackageManagerFlag(options.packageManager);
95
+ const s = p.spinner();
96
+ // 1. Create Next.js project with Tailwind v4
97
+ s.start("Creating Next.js project...");
98
+ try {
99
+ run(`npx create-next-app@latest ${options.projectName} --ts --tailwind --no-eslint --no-src-dir --app --no-import-alias --turbopack ${pmFlag} --yes`);
100
+ }
101
+ catch (err) {
102
+ s.stop("Failed to create Next.js project");
103
+ throw new Error(`create-next-app failed: ${err instanceof Error ? err.message : "Unknown error"}`);
104
+ }
105
+ s.stop("Next.js project created");
106
+ // 2. Initialize shadcn/ui
107
+ s.start("Setting up shadcn/ui...");
108
+ try {
109
+ run("npx shadcn@latest init -d --yes", projectDir);
110
+ }
111
+ catch (err) {
112
+ s.stop("Failed to initialize shadcn/ui");
113
+ throw new Error(`shadcn init failed: ${err instanceof Error ? err.message : "Unknown error"}`);
114
+ }
115
+ s.stop("shadcn/ui configured");
116
+ // 3. Add shadcn components (button, card)
117
+ s.start("Adding shadcn components...");
118
+ try {
119
+ run("npx shadcn@latest add button card -y", projectDir);
120
+ }
121
+ catch {
122
+ // Non-critical — user can add components manually
123
+ }
124
+ s.stop("shadcn components added");
125
+ // 4. Add Contentstack SDK dependencies
126
+ const deps = {
127
+ "@timbenniks/contentstack-platform-sdk": "latest",
128
+ };
129
+ if (options.features.includes("oauth")) {
130
+ deps["next-auth"] = "5.0.0-beta.30";
131
+ }
132
+ addDependencies(projectDir, deps);
133
+ // 5. Overlay Contentstack-specific template files
134
+ s.start("Scaffolding Contentstack files...");
75
135
  const context = buildContext(options);
76
136
  const templateDir = getTemplatePath(options.framework);
77
137
  if (!(0, node_fs_1.existsSync)(templateDir)) {
78
- p.log.error(`Template for "${options.framework}" not found at ${templateDir}`);
138
+ s.stop("Template not found");
79
139
  throw new Error(`Template for "${options.framework}" not found at ${templateDir}`);
80
140
  }
81
- const s = p.spinner();
82
- s.start("Scaffolding project...");
83
141
  (0, template_engine_1.renderDirectory)(templateDir, projectDir, context);
84
- s.stop("Project scaffolded");
85
- if (options.git) {
86
- if ((0, git_1.isGitAvailable)()) {
87
- s.start("Initializing git repository...");
88
- const success = (0, git_1.initGitRepo)(projectDir);
89
- s.stop(success ? "Git repository initialized" : "Git init failed (continuing)");
90
- }
91
- else {
92
- p.log.warn("git not found on PATH, skipping git init");
93
- }
94
- }
142
+ s.stop("Contentstack files added");
143
+ // 6. Install newly added dependencies
95
144
  if (options.install) {
96
145
  const cmd = (0, package_manager_1.getInstallCommand)(options.packageManager);
97
146
  s.start(`Installing dependencies (${cmd})...`);
98
147
  try {
99
- (0, package_manager_1.runInstall)(options.packageManager, projectDir);
148
+ run(cmd, projectDir);
100
149
  s.stop("Dependencies installed");
101
150
  }
102
151
  catch {
@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;QACrB,KAAK,CAAC,IAAI,CAAC,IAAA,mCAAiB,EAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA;IACvD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,MAAM,CAAC,CAAA;IAE1F,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAA;IACtC,CAAC,CAAC,KAAK,CAAC,oBAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,YAAY,CAAC,CAAC,CAAA;AACvD,CAAC"}
package/dist/types.d.ts CHANGED
@@ -14,7 +14,6 @@ export interface CLIOptions {
14
14
  features?: Feature[];
15
15
  scopes?: string[];
16
16
  packageManager?: PackageManager;
17
- git: boolean;
18
17
  install: boolean;
19
18
  }
20
19
  /** Fully resolved options after interactive prompts fill in missing values */
@@ -25,7 +24,6 @@ export interface ResolvedOptions {
25
24
  features: Feature[];
26
25
  scopes: string[];
27
26
  packageManager: PackageManager;
28
- git: boolean;
29
27
  install: boolean;
30
28
  }
31
29
  /** Context passed to Handlebars template rendering */
@@ -40,7 +38,6 @@ export interface TemplateContext {
40
38
  brandkit: boolean;
41
39
  };
42
40
  scopes: string[];
43
- sdkVersion: string;
44
41
  }
45
42
  export declare const VALID_REGIONS: Region[];
46
43
  export declare const VALID_FEATURES: Feature[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvF,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,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,EAAE,OAAO,CAAA;IAC1B,QAAQ,EAAE;QACR,GAAG,EAAE,OAAO,CAAA;QACZ,KAAK,EAAE,OAAO,CAAA;QACd,MAAM,EAAE,OAAO,CAAA;QACf,QAAQ,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,EAQjC,CAAA;AACD,eAAO,MAAM,cAAc,EAAE,OAAO,EAA2C,CAAA;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,EAAe,CAAA;AACvD,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAA4B,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAmDa,QAAA,aAAa,GAAa;IACrC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;CACT,CAAA;AACY,QAAA,cAAc,GAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;AAClE,QAAA,gBAAgB,GAAgB,CAAC,QAAQ,CAAC,CAAA;AAC1C,QAAA,sBAAsB,GAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAgDa,QAAA,aAAa,GAAa;IACrC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;CACT,CAAA;AACY,QAAA,cAAc,GAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA;AAClE,QAAA,gBAAgB,GAAgB,CAAC,QAAQ,CAAC,CAAA;AAC1C,QAAA,sBAAsB,GAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA"}
@@ -68,12 +68,6 @@
68
68
  ],
69
69
  "type": "option"
70
70
  },
71
- "no-git": {
72
- "description": "Skip git initialization",
73
- "name": "no-git",
74
- "allowNo": false,
75
- "type": "boolean"
76
- },
77
71
  "no-install": {
78
72
  "description": "Skip dependency installation",
79
73
  "name": "no-install",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timbenniks/contentstack-platform-app-scaffold",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "Contentstack CLI plugin to scaffold apps using the Platform SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,11 @@
11
11
  },
12
12
  "bin": "csdx"
13
13
  },
14
- "files": ["dist", "templates", "oclif.manifest.json"],
14
+ "files": [
15
+ "dist",
16
+ "templates",
17
+ "oclif.manifest.json"
18
+ ],
15
19
  "scripts": {
16
20
  "build": "tsc",
17
21
  "postbuild": "oclif manifest",
@@ -2,21 +2,48 @@
2
2
  CONTENTSTACK_REGION={{region}}
3
3
  CONTENTSTACK_API_KEY=your_api_key
4
4
  CONTENTSTACK_ORGANIZATION_UID=your_org_uid
5
- CONTENTSTACK_AUTHTOKEN=your_authtoken # Optional: for Launch/Brand Kit when OAuth is not enabled
6
5
  {{#if features.cma}}
7
6
  {{#unless features.oauth}}
8
- # CMA Access Token
7
+
8
+ # CMA Management Token
9
9
  CONTENTSTACK_MANAGEMENT_TOKEN=your_management_token
10
10
  {{/unless}}
11
11
  {{/if}}
12
+ {{#unless features.oauth}}
13
+ {{#if hasClientFeatures}}
14
+
15
+ # Auth Token (for Launch/Brand Kit when OAuth is not enabled)
16
+ CONTENTSTACK_AUTHTOKEN=your_authtoken
17
+ {{/if}}
18
+ {{/unless}}
12
19
  {{#if features.oauth}}
13
- # OAuth Credentials
20
+
21
+ # OAuth Credentials (from Developer Hub > Your App > OAuth)
14
22
  CONTENTSTACK_APP_ID=your_app_id
15
23
  CONTENTSTACK_CLIENT_ID=your_client_id
16
24
  CONTENTSTACK_CLIENT_SECRET=your_client_secret
17
- AUTH_SECRET=generate_a_random_secret
25
+
26
+ # Auth.js secret (generate with: openssl rand -base64 32)
27
+ AUTH_SECRET=generate_with_openssl_rand_base64_32
28
+ AUTH_TRUST_HOST=true
29
+ NEXTAUTH_URL=http://localhost:3000
18
30
  {{/if}}
19
31
  {{#if features.brandkit}}
32
+
20
33
  # Brand Kit
21
34
  CONTENTSTACK_BRAND_KIT_UID=your_brand_kit_uid
22
35
  {{/if}}
36
+ {{#if hasClientFeatures}}
37
+
38
+ # Client-side vars (NEXT_PUBLIC_ prefix exposes them to browser)
39
+ NEXT_PUBLIC_CONTENTSTACK_REGION={{region}}
40
+ NEXT_PUBLIC_CONTENTSTACK_API_KEY=your_api_key
41
+ {{#if features.launch}}
42
+ NEXT_PUBLIC_CONTENTSTACK_ORGANIZATION_UID=your_org_uid
43
+ {{else if features.brandkit}}
44
+ NEXT_PUBLIC_CONTENTSTACK_ORGANIZATION_UID=your_org_uid
45
+ {{/if}}
46
+ {{#if features.brandkit}}
47
+ NEXT_PUBLIC_CONTENTSTACK_BRAND_KIT_UID=your_brand_kit_uid
48
+ {{/if}}
49
+ {{/if}}
@@ -1,3 +1,4 @@
1
1
  import { handlers } from "@/lib/auth"
2
2
 
3
+ export const dynamic = "force-dynamic"
3
4
  export const { GET, POST } = handlers
@@ -1,9 +1,9 @@
1
- import { createBrandKitProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
2
- import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
3
1
  {{#if features.oauth}}
4
- import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
5
2
  import { auth } from "@/lib/auth"
3
+ import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
6
4
  {{/if}}
5
+ import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
6
+ import { createBrandKitProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
7
7
 
8
8
  const proxy = createBrandKitProxy({
9
9
  region: (process.env.CONTENTSTACK_REGION ?? "{{region}}") as ContentstackRegion,
@@ -18,18 +18,7 @@ const proxy = createBrandKitProxy({
18
18
  },
19
19
  })
20
20
 
21
- export async function GET(request: Request) {
22
- return proxy(request)
23
- }
24
-
25
- export async function POST(request: Request) {
26
- return proxy(request)
27
- }
28
-
29
- export async function PUT(request: Request) {
30
- return proxy(request)
31
- }
32
-
33
- export async function DELETE(request: Request) {
34
- return proxy(request)
35
- }
21
+ export const GET = proxy
22
+ export const POST = proxy
23
+ export const PUT = proxy
24
+ export const DELETE = proxy
@@ -1,9 +1,9 @@
1
- import { createCMAProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
2
- import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
3
1
  {{#if features.oauth}}
4
- import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
5
2
  import { auth } from "@/lib/auth"
3
+ import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
6
4
  {{/if}}
5
+ import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
6
+ import { createCMAProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
7
7
 
8
8
  const proxy = createCMAProxy({
9
9
  region: (process.env.CONTENTSTACK_REGION ?? "{{region}}") as ContentstackRegion,
@@ -18,18 +18,7 @@ const proxy = createCMAProxy({
18
18
  allowedScopes: ["entries:read", "entries:write", "assets:read", "content-types:read"],
19
19
  })
20
20
 
21
- export async function GET(request: Request) {
22
- return proxy(request)
23
- }
24
-
25
- export async function POST(request: Request) {
26
- return proxy(request)
27
- }
28
-
29
- export async function PUT(request: Request) {
30
- return proxy(request)
31
- }
32
-
33
- export async function DELETE(request: Request) {
34
- return proxy(request)
35
- }
21
+ export const GET = proxy
22
+ export const POST = proxy
23
+ export const PUT = proxy
24
+ export const DELETE = proxy
@@ -1,9 +1,9 @@
1
- import { createLaunchProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
2
- import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
3
1
  {{#if features.oauth}}
4
- import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
5
2
  import { auth } from "@/lib/auth"
3
+ import { getAccessToken } from "@timbenniks/contentstack-platform-sdk/server/middleware"
6
4
  {{/if}}
5
+ import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
6
+ import { createLaunchProxy } from "@timbenniks/contentstack-platform-sdk/server/proxy"
7
7
 
8
8
  const proxy = createLaunchProxy({
9
9
  region: (process.env.CONTENTSTACK_REGION ?? "{{region}}") as ContentstackRegion,
@@ -17,18 +17,7 @@ const proxy = createLaunchProxy({
17
17
  },
18
18
  })
19
19
 
20
- export async function GET(request: Request) {
21
- return proxy(request)
22
- }
23
-
24
- export async function POST(request: Request) {
25
- return proxy(request)
26
- }
27
-
28
- export async function PUT(request: Request) {
29
- return proxy(request)
30
- }
31
-
32
- export async function DELETE(request: Request) {
33
- return proxy(request)
34
- }
20
+ export const GET = proxy
21
+ export const POST = proxy
22
+ export const PUT = proxy
23
+ export const DELETE = proxy
@@ -1,25 +1,40 @@
1
1
  "use client"
2
2
 
3
3
  import { useAssets } from "@timbenniks/contentstack-platform-sdk/react/hooks"
4
+ import { Button } from "@/components/ui/button"
5
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
4
6
 
5
7
  export default function AssetsPage() {
6
8
  const { data: assets, loading, error } = useAssets()
7
9
 
8
10
  return (
9
- <main style=\{{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
10
- <h1>Assets</h1>
11
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
12
+ <h1 className="text-3xl font-bold mb-2">Assets</h1>
13
+ <p className="text-muted-foreground mb-6">Browse your stack assets</p>
11
14
 
12
- {loading && <p>Loading assets...</p>}
13
- {error && <p>Error: {error.message}</p>}
14
- {assets && (
15
- <ul>
16
- {assets.map((asset) => (
17
- <li key={asset.uid}>{asset.title ?? asset.filename}</li>
18
- ))}
19
- </ul>
20
- )}
15
+ <Card>
16
+ <CardHeader>
17
+ <CardTitle>Stack Assets</CardTitle>
18
+ <CardDescription>Fetched via the CMA proxy</CardDescription>
19
+ </CardHeader>
20
+ <CardContent>
21
+ {loading && <p className="text-muted-foreground">Loading assets...</p>}
22
+ {error && <p className="text-destructive">Error: {error.message}</p>}
23
+ {assets && (
24
+ <ul className="space-y-1">
25
+ {assets.map((asset) => (
26
+ <li key={asset.uid} className="text-sm py-1 border-b border-border last:border-0">
27
+ {asset.title ?? asset.filename}
28
+ </li>
29
+ ))}
30
+ </ul>
31
+ )}
32
+ </CardContent>
33
+ </Card>
21
34
 
22
- <p><a href="/">Back to home</a></p>
35
+ <Button variant="outline" asChild className="mt-6">
36
+ <a href="/">Back to home</a>
37
+ </Button>
23
38
  </main>
24
39
  )
25
40
  }
@@ -2,6 +2,8 @@
2
2
 
3
3
  import type { BrandKit } from "@timbenniks/contentstack-platform-sdk/brandkit"
4
4
  import { useBrandKit } from "@timbenniks/contentstack-platform-sdk/react/hooks"
5
+ import { Button } from "@/components/ui/button"
6
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
5
7
  import { useEffect, useState } from "react"
6
8
 
7
9
  export default function BrandKitPage() {
@@ -19,25 +21,36 @@ export default function BrandKitPage() {
19
21
  }, [brandKit])
20
22
 
21
23
  return (
22
- <main style=\{{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
23
- <h1>Brand Kits</h1>
24
-
25
- {loading && <p>Loading brand kits...</p>}
26
- {error && <p>Error: {error}</p>}
27
-
28
- {!loading && !error && (
29
- <ul>
30
- {brandKits.map((kit) => (
31
- <li key={kit.uid}>{kit.name}</li>
32
- ))}
33
- </ul>
34
- )}
35
-
36
- {!loading && !error && brandKits.length === 0 && (
37
- <p>No brand kits found for this organization.</p>
38
- )}
39
-
40
- <p><a href="/">Back to home</a></p>
24
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
25
+ <h1 className="text-3xl font-bold mb-2">Brand Kits</h1>
26
+ <p className="text-muted-foreground mb-6">Manage your brand kits and voice profiles</p>
27
+
28
+ <Card>
29
+ <CardHeader>
30
+ <CardTitle>Brand Kits</CardTitle>
31
+ <CardDescription>Fetched via the Brand Kit proxy</CardDescription>
32
+ </CardHeader>
33
+ <CardContent>
34
+ {loading && <p className="text-muted-foreground">Loading brand kits...</p>}
35
+ {error && <p className="text-destructive">Error: {error}</p>}
36
+ {!loading && !error && brandKits.length === 0 && (
37
+ <p className="text-muted-foreground">No brand kits found for this organization.</p>
38
+ )}
39
+ {!loading && !error && (
40
+ <ul className="space-y-1">
41
+ {brandKits.map((kit) => (
42
+ <li key={kit.uid} className="text-sm py-1 border-b border-border last:border-0">
43
+ {kit.name}
44
+ </li>
45
+ ))}
46
+ </ul>
47
+ )}
48
+ </CardContent>
49
+ </Card>
50
+
51
+ <Button variant="outline" asChild className="mt-6">
52
+ <a href="/">Back to home</a>
53
+ </Button>
41
54
  </main>
42
55
  )
43
56
  }
@@ -1,26 +1,42 @@
1
1
  "use client"
2
2
 
3
3
  import { useEntries } from "@timbenniks/contentstack-platform-sdk/react/hooks"
4
+ import { Button } from "@/components/ui/button"
5
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
4
6
 
5
7
  export default function EntriesPage() {
6
8
  const { data: entries, loading, error } = useEntries("your_content_type")
7
9
 
8
10
  return (
9
- <main style=\{{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
10
- <h1>Entries</h1>
11
- <p>Update <code>&quot;your_content_type&quot;</code> to a content type UID from your stack.</p>
11
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
12
+ <h1 className="text-3xl font-bold mb-2">Entries</h1>
13
+ <p className="text-muted-foreground mb-6">
14
+ Update <code className="text-xs bg-muted px-1 py-0.5 rounded">"your_content_type"</code> to a content type UID from your stack.
15
+ </p>
12
16
 
13
- {loading && <p>Loading entries...</p>}
14
- {error && <p>Error: {error.message}</p>}
15
- {entries && (
16
- <ul>
17
- {entries.map((entry) => (
18
- <li key={entry.uid}>{entry.title ?? entry.uid}</li>
19
- ))}
20
- </ul>
21
- )}
17
+ <Card>
18
+ <CardHeader>
19
+ <CardTitle>Content Entries</CardTitle>
20
+ <CardDescription>Fetched via the CMA proxy</CardDescription>
21
+ </CardHeader>
22
+ <CardContent>
23
+ {loading && <p className="text-muted-foreground">Loading entries...</p>}
24
+ {error && <p className="text-destructive">Error: {error.message}</p>}
25
+ {entries && (
26
+ <ul className="space-y-1">
27
+ {entries.map((entry) => (
28
+ <li key={entry.uid} className="text-sm py-1 border-b border-border last:border-0">
29
+ {entry.title ?? entry.uid}
30
+ </li>
31
+ ))}
32
+ </ul>
33
+ )}
34
+ </CardContent>
35
+ </Card>
22
36
 
23
- <p><a href="/">Back to home</a></p>
37
+ <Button variant="outline" asChild className="mt-6">
38
+ <a href="/">Back to home</a>
39
+ </Button>
24
40
  </main>
25
41
  )
26
42
  }
@@ -0,0 +1,98 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+ @import "shadcn/tailwind.css";
4
+ @import "@timbenniks/contentstack-platform-sdk/ui/tokens.css";
5
+
6
+ @custom-variant dark (&:is(.dark *));
7
+
8
+ @theme inline {
9
+ --color-background: var(--background);
10
+ --color-foreground: var(--foreground);
11
+ --font-sans: var(--font-geist-sans);
12
+ --font-mono: var(--font-geist-mono);
13
+ --color-sidebar-ring: var(--sidebar-ring);
14
+ --color-sidebar-border: var(--sidebar-border);
15
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
16
+ --color-sidebar-accent: var(--sidebar-accent);
17
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
18
+ --color-sidebar-primary: var(--sidebar-primary);
19
+ --color-sidebar-foreground: var(--sidebar-foreground);
20
+ --color-sidebar: var(--sidebar);
21
+ --color-chart-5: var(--chart-5);
22
+ --color-chart-4: var(--chart-4);
23
+ --color-chart-3: var(--chart-3);
24
+ --color-chart-2: var(--chart-2);
25
+ --color-chart-1: var(--chart-1);
26
+ --color-ring: var(--ring);
27
+ --color-input: var(--input);
28
+ --color-border: var(--border);
29
+ --color-destructive: var(--destructive);
30
+ --color-accent-foreground: var(--accent-foreground);
31
+ --color-accent: var(--accent);
32
+ --color-muted-foreground: var(--muted-foreground);
33
+ --color-muted: var(--muted);
34
+ --color-secondary-foreground: var(--secondary-foreground);
35
+ --color-secondary: var(--secondary);
36
+ --color-primary-foreground: var(--primary-foreground);
37
+ --color-primary: var(--primary);
38
+ --color-popover-foreground: var(--popover-foreground);
39
+ --color-popover: var(--popover);
40
+ --color-card-foreground: var(--card-foreground);
41
+ --color-card: var(--card);
42
+ --radius-sm: calc(var(--radius) - 4px);
43
+ --radius-md: calc(var(--radius) - 2px);
44
+ --radius-lg: var(--radius);
45
+ --radius-xl: calc(var(--radius) + 4px);
46
+ --radius-2xl: calc(var(--radius) + 8px);
47
+ --radius-3xl: calc(var(--radius) + 12px);
48
+ --radius-4xl: calc(var(--radius) + 16px);
49
+ }
50
+
51
+ /*
52
+ * Contentstack Venus Design System → shadcn/ui mapping
53
+ * Token values come from @timbenniks/contentstack-platform-sdk/ui/tokens.css
54
+ * See: https://github.com/timbenniks/contentstack-platform-sdk
55
+ */
56
+ :root {
57
+ --radius: 0.5rem;
58
+ --background: var(--cs-color-base-white-5);
59
+ --foreground: var(--cs-color-brand-secondary-dark);
60
+ --card: var(--cs-color-base-white-5);
61
+ --card-foreground: var(--cs-color-brand-secondary-dark);
62
+ --popover: var(--cs-color-base-white-5);
63
+ --popover-foreground: var(--cs-color-brand-secondary-dark);
64
+ --primary: var(--cs-color-brand-primary-base);
65
+ --primary-foreground: var(--cs-color-base-white-5);
66
+ --secondary: var(--cs-color-brand-secondary-lighter);
67
+ --secondary-foreground: var(--cs-color-brand-secondary-dark);
68
+ --muted: var(--cs-color-base-white-10);
69
+ --muted-foreground: var(--cs-color-brand-secondary-base);
70
+ --accent: var(--cs-color-brand-primary-light);
71
+ --accent-foreground: var(--cs-color-brand-primary-dark);
72
+ --destructive: var(--cs-color-brand-warning-base);
73
+ --border: var(--cs-color-brand-secondary-lightest);
74
+ --input: var(--cs-color-brand-secondary-medium);
75
+ --ring: var(--cs-color-brand-primary-base);
76
+ --chart-1: var(--cs-color-brand-primary-base);
77
+ --chart-2: var(--cs-color-brand-success-base);
78
+ --chart-3: var(--cs-color-brand-info-base);
79
+ --chart-4: var(--cs-color-brand-attention-base);
80
+ --chart-5: var(--cs-color-accent-medium-orchid);
81
+ --sidebar: var(--cs-color-base-white-10);
82
+ --sidebar-foreground: var(--cs-color-brand-secondary-dark);
83
+ --sidebar-primary: var(--cs-color-brand-primary-base);
84
+ --sidebar-primary-foreground: var(--cs-color-base-white-5);
85
+ --sidebar-accent: var(--cs-color-brand-primary-light);
86
+ --sidebar-accent-foreground: var(--cs-color-brand-primary-dark);
87
+ --sidebar-border: var(--cs-color-brand-secondary-lightest);
88
+ --sidebar-ring: var(--cs-color-brand-primary-base);
89
+ }
90
+
91
+ @layer base {
92
+ * {
93
+ @apply border-border outline-ring/50;
94
+ }
95
+ body {
96
+ @apply bg-background text-foreground;
97
+ }
98
+ }
@@ -2,6 +2,8 @@
2
2
 
3
3
  import type { LaunchProject } from "@timbenniks/contentstack-platform-sdk/launch"
4
4
  import { useLaunch } from "@timbenniks/contentstack-platform-sdk/react/hooks"
5
+ import { Button } from "@/components/ui/button"
6
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
5
7
  import { useEffect, useState } from "react"
6
8
 
7
9
  export default function LaunchPage() {
@@ -19,25 +21,36 @@ export default function LaunchPage() {
19
21
  }, [launch])
20
22
 
21
23
  return (
22
- <main style=\{{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
23
- <h1>Launch Projects</h1>
24
-
25
- {loading && <p>Loading projects...</p>}
26
- {error && <p>Error: {error}</p>}
27
-
28
- {!loading && !error && (
29
- <ul>
30
- {projects.map((project) => (
31
- <li key={project.uid}>{project.name}</li>
32
- ))}
33
- </ul>
34
- )}
35
-
36
- {!loading && !error && projects.length === 0 && (
37
- <p>No projects found in this organization.</p>
38
- )}
39
-
40
- <p><a href="/">Back to home</a></p>
24
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
25
+ <h1 className="text-3xl font-bold mb-2">Launch Projects</h1>
26
+ <p className="text-muted-foreground mb-6">Manage your deployment projects</p>
27
+
28
+ <Card>
29
+ <CardHeader>
30
+ <CardTitle>Projects</CardTitle>
31
+ <CardDescription>Fetched via the Launch proxy</CardDescription>
32
+ </CardHeader>
33
+ <CardContent>
34
+ {loading && <p className="text-muted-foreground">Loading projects...</p>}
35
+ {error && <p className="text-destructive">Error: {error}</p>}
36
+ {!loading && !error && projects.length === 0 && (
37
+ <p className="text-muted-foreground">No projects found in this organization.</p>
38
+ )}
39
+ {!loading && !error && (
40
+ <ul className="space-y-1">
41
+ {projects.map((project) => (
42
+ <li key={project.uid} className="text-sm py-1 border-b border-border last:border-0">
43
+ {project.name}
44
+ </li>
45
+ ))}
46
+ </ul>
47
+ )}
48
+ </CardContent>
49
+ </Card>
50
+
51
+ <Button variant="outline" asChild className="mt-6">
52
+ <a href="/">Back to home</a>
53
+ </Button>
41
54
  </main>
42
55
  )
43
56
  }
@@ -1,18 +1,33 @@
1
1
  import type { Metadata } from "next"
2
- import type { ReactNode } from "react"
2
+ import { Geist, Geist_Mono } from "next/font/google"
3
+ import "./globals.css"
3
4
  {{#if hasClientFeatures}}
4
5
  import { Providers } from "./providers"
5
6
  {{/if}}
6
7
 
8
+ const geistSans = Geist({
9
+ variable: "--font-geist-sans",
10
+ subsets: ["latin"],
11
+ })
12
+
13
+ const geistMono = Geist_Mono({
14
+ variable: "--font-geist-mono",
15
+ subsets: ["latin"],
16
+ })
17
+
7
18
  export const metadata: Metadata = {
8
19
  title: "{{projectName}}",
9
20
  description: "Built with Contentstack Platform SDK",
10
21
  }
11
22
 
12
- export default function RootLayout({ children }: { children: ReactNode }) {
23
+ export default function RootLayout({
24
+ children,
25
+ }: Readonly<{
26
+ children: React.ReactNode
27
+ }>) {
13
28
  return (
14
29
  <html lang="en">
15
- <body>
30
+ <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
16
31
  {{#if hasClientFeatures}}<Providers>{children}</Providers>{{else}}{children}{{/if}}
17
32
  </body>
18
33
  </html>
@@ -1,55 +1,159 @@
1
1
  {{#if features.oauth}}
2
- import { auth } from "@/lib/auth"
3
- {{/if}}
2
+ import { auth, signIn, signOut } from "@/lib/auth"
3
+ import { Button } from "@/components/ui/button"
4
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
5
+
6
+ export const dynamic = "force-dynamic"
4
7
 
5
- export default {{#if features.oauth}}async {{/if}}function Home() {
6
- {{#if features.oauth}}
8
+ export default async function Home() {
7
9
  const session = await auth()
8
- {{/if}}
10
+
11
+ if (session) {
12
+ return (
13
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
14
+ <h1 className="text-3xl font-bold mb-2">
15
+ Welcome, {(session.user as { name?: string })?.name ?? "User"}
16
+ </h1>
17
+ <p className="text-muted-foreground mb-8">You are signed in with Contentstack.</p>
18
+
19
+ <div className="grid gap-4">
20
+ {{#if features.cma}}
21
+ <Card>
22
+ <CardHeader>
23
+ <CardTitle>Content Management</CardTitle>
24
+ <CardDescription>Manage your entries and assets</CardDescription>
25
+ </CardHeader>
26
+ <CardContent className="flex gap-2">
27
+ <Button variant="secondary" asChild><a href="/entries">Entries</a></Button>
28
+ <Button variant="secondary" asChild><a href="/assets">Assets</a></Button>
29
+ </CardContent>
30
+ </Card>
31
+ {{/if}}
32
+ {{#if features.launch}}
33
+ <Card>
34
+ <CardHeader>
35
+ <CardTitle>Launch</CardTitle>
36
+ <CardDescription>Manage your deployment projects</CardDescription>
37
+ </CardHeader>
38
+ <CardContent>
39
+ <Button variant="secondary" asChild><a href="/launch">Projects</a></Button>
40
+ </CardContent>
41
+ </Card>
42
+ {{/if}}
43
+ {{#if features.brandkit}}
44
+ <Card>
45
+ <CardHeader>
46
+ <CardTitle>Brand Kit AI</CardTitle>
47
+ <CardDescription>Manage your brand kits and voice profiles</CardDescription>
48
+ </CardHeader>
49
+ <CardContent>
50
+ <Button variant="secondary" asChild><a href="/brandkit">Brand Kits</a></Button>
51
+ </CardContent>
52
+ </Card>
53
+ {{/if}}
54
+ </div>
55
+
56
+ <form
57
+ className="mt-8"
58
+ action={async () => {
59
+ "use server"
60
+ await signOut({ redirectTo: "/" })
61
+ }}
62
+ >
63
+ <Button variant="outline" type="submit">Sign Out</Button>
64
+ </form>
65
+ </main>
66
+ )
67
+ }
9
68
 
10
69
  return (
11
- <main style=\{{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
12
- <h1>{{projectName}}</h1>
13
- <p>Region: <code>{{region}}</code></p>
14
- <p>Built with <a href="https://github.com/contentstack/platform-sdk">Contentstack Platform SDK</a></p>
15
-
16
- <h2>Getting Started</h2>
17
- <ol>
18
- <li>Copy <code>.env.example</code> to <code>.env.local</code></li>
19
- <li>Fill in your Contentstack credentials</li>
20
- <li>Start building!</li>
21
- </ol>
22
- {{#if features.oauth}}
23
-
24
- <h2>Authentication</h2>
25
- {session ? (
26
- <p>Signed in. <a href="/api/auth/signout">Sign out</a></p>
27
- ) : (
28
- <p><a href="/api/auth/signin">Sign in with Contentstack</a></p>
29
- )}
30
- {{/if}}
70
+ <main className="min-h-screen flex items-center justify-center p-8">
71
+ <Card className="w-full max-w-md">
72
+ <CardHeader>
73
+ <CardTitle className="text-2xl">{{projectName}}</CardTitle>
74
+ <CardDescription>
75
+ Region: <code className="text-xs bg-muted px-1 py-0.5 rounded">{{region}}</code>
76
+ </CardDescription>
77
+ </CardHeader>
78
+ <CardContent className="space-y-4">
79
+ <ol className="list-decimal list-inside text-sm text-muted-foreground space-y-1">
80
+ <li>Copy <code className="text-xs bg-muted px-1 py-0.5 rounded">.env.example</code> to <code className="text-xs bg-muted px-1 py-0.5 rounded">.env.local</code></li>
81
+ <li>Fill in your Contentstack credentials</li>
82
+ <li>Start building!</li>
83
+ </ol>
84
+ <form
85
+ action={async () => {
86
+ "use server"
87
+ await signIn("contentstack", { redirectTo: "/" })
88
+ }}
89
+ >
90
+ <Button className="w-full" type="submit">Sign in with Contentstack</Button>
91
+ </form>
92
+ </CardContent>
93
+ </Card>
94
+ </main>
95
+ )
96
+ }
97
+ {{else}}
98
+ import { Button } from "@/components/ui/button"
99
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
100
+
101
+ export default function Home() {
102
+ return (
103
+ <main className="min-h-screen p-8 max-w-2xl mx-auto">
104
+ <h1 className="text-3xl font-bold mb-2">{{projectName}}</h1>
105
+ <p className="text-muted-foreground mb-8">
106
+ Region: <code className="text-xs bg-muted px-1 py-0.5 rounded">{{region}}</code>
107
+ </p>
108
+
109
+ <Card className="mb-6">
110
+ <CardHeader>
111
+ <CardTitle>Getting Started</CardTitle>
112
+ <CardDescription>Set up your Contentstack credentials to begin</CardDescription>
113
+ </CardHeader>
114
+ <CardContent>
115
+ <ol className="list-decimal list-inside text-sm text-muted-foreground space-y-1">
116
+ <li>Copy <code className="text-xs bg-muted px-1 py-0.5 rounded">.env.example</code> to <code className="text-xs bg-muted px-1 py-0.5 rounded">.env.local</code></li>
117
+ <li>Fill in your Contentstack credentials</li>
118
+ <li>Start building!</li>
119
+ </ol>
120
+ </CardContent>
121
+ </Card>
31
122
  {{#if features.cma}}
32
123
 
33
- <h2>Content Management</h2>
34
- <ul>
35
- <li><a href="/entries">Entries</a></li>
36
- <li><a href="/assets">Assets</a></li>
37
- </ul>
124
+ <Card className="mb-4">
125
+ <CardHeader>
126
+ <CardTitle>Content Management</CardTitle>
127
+ </CardHeader>
128
+ <CardContent className="flex gap-2">
129
+ <Button variant="secondary" asChild><a href="/entries">Entries</a></Button>
130
+ <Button variant="secondary" asChild><a href="/assets">Assets</a></Button>
131
+ </CardContent>
132
+ </Card>
38
133
  {{/if}}
39
134
  {{#if features.launch}}
40
135
 
41
- <h2>Launch</h2>
42
- <ul>
43
- <li><a href="/launch">Projects</a></li>
44
- </ul>
136
+ <Card className="mb-4">
137
+ <CardHeader>
138
+ <CardTitle>Launch</CardTitle>
139
+ </CardHeader>
140
+ <CardContent>
141
+ <Button variant="secondary" asChild><a href="/launch">Projects</a></Button>
142
+ </CardContent>
143
+ </Card>
45
144
  {{/if}}
46
145
  {{#if features.brandkit}}
47
146
 
48
- <h2>Brand Kit AI</h2>
49
- <ul>
50
- <li><a href="/brandkit">Brand Kits</a></li>
51
- </ul>
147
+ <Card className="mb-4">
148
+ <CardHeader>
149
+ <CardTitle>Brand Kit AI</CardTitle>
150
+ </CardHeader>
151
+ <CardContent>
152
+ <Button variant="secondary" asChild><a href="/brandkit">Brand Kits</a></Button>
153
+ </CardContent>
154
+ </Card>
52
155
  {{/if}}
53
156
  </main>
54
157
  )
55
158
  }
159
+ {{/if}}
@@ -4,7 +4,19 @@ import { ContentstackProvider } from "@timbenniks/contentstack-platform-sdk/reac
4
4
 
5
5
  export function Providers({ children }: { children: React.ReactNode }) {
6
6
  return (
7
- <ContentstackProvider region="{{region}}">
7
+ <ContentstackProvider
8
+ region={process.env.NEXT_PUBLIC_CONTENTSTACK_REGION as "{{region}}" ?? "{{region}}"}
9
+ apiKey={process.env.NEXT_PUBLIC_CONTENTSTACK_API_KEY ?? ""}
10
+ proxyBasePath="/api/cma"
11
+ {{#if features.launch}}
12
+ organizationUid={process.env.NEXT_PUBLIC_CONTENTSTACK_ORGANIZATION_UID ?? ""}
13
+ {{else if features.brandkit}}
14
+ organizationUid={process.env.NEXT_PUBLIC_CONTENTSTACK_ORGANIZATION_UID ?? ""}
15
+ {{/if}}
16
+ {{#if features.brandkit}}
17
+ brandKitUid={process.env.NEXT_PUBLIC_CONTENTSTACK_BRAND_KIT_UID ?? ""}
18
+ {{/if}}
19
+ >
8
20
  {children}
9
21
  </ContentstackProvider>
10
22
  )
@@ -1,12 +1,50 @@
1
- import { createContentstackAuth } from "@timbenniks/contentstack-platform-sdk/server/middleware"
2
1
  import type { ContentstackRegion } from "@timbenniks/contentstack-platform-sdk/regions"
2
+ import { createContentstackAuth } from "@timbenniks/contentstack-platform-sdk/server/middleware"
3
+ import type { NextRequest } from "next/server"
4
+
5
+ type AuthConfig = Awaited<ReturnType<typeof createContentstackAuth>>
6
+
7
+ let _authConfig: AuthConfig | null = null
8
+
9
+ async function getAuthConfig(): Promise<AuthConfig> {
10
+ if (!_authConfig) {
11
+ _authConfig = await createContentstackAuth({
12
+ region: (process.env.CONTENTSTACK_REGION ?? "{{region}}") as ContentstackRegion,
13
+ appId: process.env.CONTENTSTACK_APP_ID!,
14
+ clientId: process.env.CONTENTSTACK_CLIENT_ID!,
15
+ clientSecret: process.env.CONTENTSTACK_CLIENT_SECRET!,
16
+ secret: process.env.AUTH_SECRET!,
17
+ scopes: [{{#each scopes}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}],
18
+ trustHost: true,
19
+ signInPage: "/",
20
+ errorPage: "/",
21
+ })
22
+ }
23
+ return _authConfig
24
+ }
25
+
26
+ export const handlers = {
27
+ GET: async (req: NextRequest) => {
28
+ const config = await getAuthConfig()
29
+ return config.handlers.GET(req)
30
+ },
31
+ POST: async (req: NextRequest) => {
32
+ const config = await getAuthConfig()
33
+ return config.handlers.POST(req)
34
+ },
35
+ }
36
+
37
+ export async function auth() {
38
+ const config = await getAuthConfig()
39
+ return config.auth()
40
+ }
41
+
42
+ export async function signIn(provider?: string, options?: Record<string, unknown>) {
43
+ const config = await getAuthConfig()
44
+ return config.signIn(provider, options)
45
+ }
3
46
 
4
- export const { handlers, auth } = await createContentstackAuth({
5
- region: (process.env.CONTENTSTACK_REGION ?? "{{region}}") as ContentstackRegion,
6
- appId: process.env.CONTENTSTACK_APP_ID!,
7
- clientId: process.env.CONTENTSTACK_CLIENT_ID!,
8
- clientSecret: process.env.CONTENTSTACK_CLIENT_SECRET!,
9
- secret: process.env.AUTH_SECRET!,
10
- scopes: [{{#each scopes}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}],
11
- trustHost: true,
12
- })
47
+ export async function signOut(options?: Record<string, unknown>) {
48
+ const config = await getAuthConfig()
49
+ return config.signOut(options)
50
+ }
@@ -1,10 +1,9 @@
1
1
  [
2
- { "path": "package.json" },
3
2
  { "path": ".env.example" },
4
- { "path": ".gitignore" },
5
- { "path": "tsconfig.json" },
6
- { "path": "next.config.js" },
3
+ { "path": "next.config.ts" },
4
+ { "path": "types/next-auth.d.ts", "requiredFeatures": ["oauth"] },
7
5
  { "path": "lib/auth.ts", "requiredFeatures": ["oauth"] },
6
+ { "path": "app/globals.css" },
8
7
  { "path": "app/layout.tsx" },
9
8
  { "path": "app/page.tsx" },
10
9
  { "path": "app/providers.tsx", "anyFeatures": ["cma", "launch", "brandkit"] },
@@ -0,0 +1,7 @@
1
+ import type { NextConfig } from "next"
2
+
3
+ const nextConfig: NextConfig = {
4
+ transpilePackages: ["@timbenniks/contentstack-platform-sdk"],
5
+ }
6
+
7
+ export default nextConfig
@@ -0,0 +1,8 @@
1
+ import "next-auth"
2
+
3
+ declare module "next-auth" {
4
+ interface Session {
5
+ accessToken?: string
6
+ error?: "RefreshAccessTokenError"
7
+ }
8
+ }
@@ -1,4 +0,0 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {}
3
-
4
- module.exports = nextConfig
@@ -1,24 +0,0 @@
1
- {
2
- "name": "{{projectName}}",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev",
7
- "build": "next build",
8
- "start": "next start",
9
- "lint": "next lint"
10
- },
11
- "dependencies": {
12
- "next": "^15.0.0",
13
- "react": "^19.0.0",
14
- "react-dom": "^19.0.0",
15
- "@timbenniks/contentstack-platform-sdk": "^{{sdkVersion}}"{{#if features.oauth}},
16
- "next-auth": "5.0.0-beta.30"{{/if}}
17
- },
18
- "devDependencies": {
19
- "typescript": "^5.5.0",
20
- "@types/react": "^19.0.0",
21
- "@types/react-dom": "^19.0.0",
22
- "@types/node": "^22.0.0"
23
- }
24
- }
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "preserve",
15
- "incremental": true,
16
- "plugins": [{ "name": "next" }],
17
- "paths": { "@/*": ["./*"] }
18
- },
19
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
20
- "exclude": ["node_modules"]
21
- }