Environment Variables
Configuration variables for Next.js and Drupal.
.env.local
# BasicNEXT_DRUPAL_BASE_URL=https://backend.vactory.lecontenaire.comNEXT_BASE_URL=https://vactory.lecontenaire.comNEXT_IMAGE_DOMAIN=vactory.lecontenaire.com
# Redis CacheREDIS_PREFIX=vactoryREDIS_HOST=127.0.0.1REDIS_PORT=6379REDIS_USERNAME=defaultREDIS_PASSWORD=eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
# AuthenticationNEXTAUTH_URL=https://vactory.lecontenaire.comNEXTAUTH_SECRET=123456JWT_SIGNING_PRIVATE_KEY={"kty":"oct","kid":"o5rYv_twJF3n2nEvsKtYoQmlFX0TO48P7hh_cSVjLBk","alg":"HS512","k":"j_MX1m1k8HFX6qZENRwDcx5Uay2WGQrN_LkQ9VdCnSj7dx0QlUajvx0WMImBgzsy17pI69KENB4cs7RtSLylJQ"}%
# Authentication (OAuth Provider)OAUTH_CLIENT_ID=57a079aa-06e4-4725-9b38-49722901468eOAUTH_CLIENT_SECRET=123456
# Authentication (Keycloak Provider)KEYCLOAK_ID=keycloakKEYCLOAK_SECRET=KEYCLOAK_ISSUER=
# ReCaptchaNEXT_RECAPTCHA_SITEKEY=6LdccOUeAAAAAKnRDy2yPKLc9YAy-Jn-CdKhrjUmRECAPTCHA_SECRETKEY=6LdccOUeAAAAAHKQlW3f3B5khCjx0B5rBFZTN7P1
# Cache invalidationCACHE_SECRET=4467543228
# Debug mode for fetchDRUPAL_CLIENT_DEBUG=TRUE
Basic
These environment variables are required to connect to Drupal.
Name | Description |
---|---|
NEXT_DRUPAL_BASE_URL | The base url for your Drupal site. Example: http://localhost:8080 |
NEXT_BASE_URL | The base url for your Next.js site. Example: http://localhost |
NEXT_IMAGE_DOMAIN | The domain name for next/image. Example: localhost |
Redis Cache
Environment variables required for redis cache.
Name | Description |
---|---|
REDIS_HOST | Can be a host, or the path to a unix domain socket. |
REDIS_PORT | Default is 6379, should be -1 for unix domain socket |
REDIS_USERNAME | Default is default |
REDIS_PASSWORD | Default is eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81 |
REDIS_PREFIX | Used as a prefix to the Redis key |
import Client from "ioredis"
const redis = new Client({ port: process.env.REDIS_PORT, host: process.env.REDIS_HOST, username: process.env.REDIS_USERNAME, // needs Redis >= 6 password: process.env.REDIS_PASSWORD, keyPrefix: process.env.REDIS_PREFIX, db: 0, // Defaults to 0})
Authentication
Using OAuth Password Grant.
Name | Description |
---|---|
OAUTH_CLIENT_ID | Drupal OAuth Client ID. See www.drupal.org/project/simple_oauth |
OAUTH_CLIENT_SECRET | Drupal OAuth Client Secret. See www.drupal.org/project/simple_oauth |
Authentication (OAuth Provider)
Name | Description |
---|---|
KEYCLOAK_ID | Keycloak OAuth Client ID |
KEYCLOAK_SECRET | Keycloak OAuth Client Secret. |
KEYCLOAK_ISSUER | Keycloak Issuer URL |
ReCaptcha
Name | Description |
---|---|
NEXT_RECAPTCHA_SITEKEY | ReCaptcha site key. See https://www.google.com/recaptcha/ |
RECAPTCHA_SECRETKEY | ReCaptcha site secret key. See https://www.google.com/recaptcha/ |
Cache Invalidation
Name | Description |
---|---|
CACHE_SECRET | Grant access to /api/cache/clear , Example 4467543228 , Curl POST /api/cache/clear -H x-cache-secret=4467543228 |
Drupal Client
Name | Description |
---|---|
DRUPAL_CLIENT_DEBUG | If defined, the drupal client will start logging debug informations |