Skip to content

Instantly share code, notes, and snippets.

View nehemiahj's full-sized avatar

Nehemiah Jeyakumar nehemiahj

View GitHub Profile
@nehemiahj
nehemiahj / vercelEdgeConfigMiddleware.ts
Created March 14, 2024 21:32
Vercel Edge Config - Middleware
import { NextRequest, NextResponse } from "next/server";
import { get } from "@vercel/edge-config";
export const config = {
matcher: "/payment",
};
export async function middleware(req: NextRequest) {
// Check Edge Config to see if the maintenance page should be shown
const isInMaintenanceMode = await get("isInMaintenanceMode");
@nehemiahj
nehemiahj / vercelEdgeConfig.tsx
Created March 14, 2024 19:07
Vercel Edge Config
import { get, has, getAll } from '@vercel/edge-config';
// To read a single key
const someValue = await get("someKey")
// To check if a key exists
const someValue = await has('someKey');
// To read all the items in data store
const someValue = await getAll();
@nehemiahj
nehemiahj / getOrganizationLicense.txt
Last active February 15, 2024 19:08
Get Organization License from XM Cloud
<xmcloud-nehem> dotnet sitecore cloud organization license --organization-id org_xxxxxxxxxxxxxxxx
Organization license has been saved to C:\Project\GitHub\xmcloud-nehem.
@nehemiahj
nehemiahj / getOrganizationHealth.txt
Last active February 15, 2024 19:09
XM Cloud Get OrganizationHealth
<xmcloud-nehem> dotnet sitecore cloud organization health --organization-id org_xxxxxxxxxxxxx
Organization resources health status: Healthy
@nehemiahj
nehemiahj / OrganizationInformation.txt
Last active February 15, 2024 19:09
Organization Information
<xmcloud-nehem> dotnet sitecore cloud organization info --organization-id org_xxxxxxxxxxxxxxxx
Id : org_xxxxxxxxxxxxxxxx
Name : epam-xxxx
Region : eus
CreatedAt : 5/8/2023 11:45:50 PM
CreatedBy : Automation
Tier : Corporate
@nehemiahj
nehemiahj / getOrganizationInformation.ps1
Created February 15, 2024 18:53
Get Organization Information
dotnet sitecore cloud organization info --organization-id org_xxxxxxxxxxxxxxxx
@nehemiahj
nehemiahj / removeAndAddPlugin.ps1
Last active February 15, 2024 18:50
Remove and Add Plugin CLI Command
# Remove XM Cloud Plugin
dotnet sitecore plugin remove -n Sitecore.DevEx.Extensibility.XMCloud
# Add XM Cloud Plugin with the latest version
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.XMCloud
@nehemiahj
nehemiahj / createDeployment.ps1
Created October 10, 2023 15:10
Wait for Post Deployment Actions in CLI
dotnet sitecore cloud deployment create --environment-id 75Uqhws1LX11cOZsRD9s2K --waitForPostActions true
@nehemiahj
nehemiahj / xmcloud.build.json
Last active October 10, 2023 14:33
A sample XM Cloud Build configuration
{
"deployItems": {
"modules": ["SxaStarter.Feature.ScheduledPublish"]
},
"buildTargets": [
"./src/Plugin.csproj",
"./XmCloudSXAStarter.sln"
],
"renderingHosts": {
"sxastarter": {
@nehemiahj
nehemiahj / createDeploymentWithUpload.ps1
Created September 26, 2023 14:43
Sitecore XM Cloud CLI Create Deployment with Upload option
dotnet sitecore cloud deployment create --environment-id 7na1U1zw35V0ptXIGrC1uE --upload