Download the PHP package pantheon-systems-ps/pantheon_nextjs_multi_demo without Composer

On this page you can find all versions of the php package pantheon-systems-ps/pantheon_nextjs_multi_demo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pantheon_nextjs_multi_demo

Pantheon Next.js: Global

Vertical-agnostic backbone for a decoupled Drupal + Next.js architecture on Pantheon. It configures a standard Drupal site as a headless content backend that can serve one or many independent Next.js front ends from a single install.

Apply this recipe first, then apply one or more vertical recipes on top (such as pantheon_nextjs_edu_demo or pantheon_nextjs_commerce_demo) to register a front end and its content.

Requirements

What it configures

This recipe ships no next_site entity and no content; those are provided by the vertical recipes.

Apply

Then apply one or more vertical recipes.

How a front end scopes its content

Each front end filters JSON:API by the field_next_site reference:

A front end that omits the filter renders all content: one backend serving everything, or many front ends each serving their own slice.

Draft preview

Draft preview lets a front end display unpublished Drupal content. This recipe configures the structural pieces: the Simple OAuth preview generator, the nextjs_preview role, and a matching OAuth scope. The remaining pieces carry secrets or are content entities, so complete them once per site as an administrator.

1. Generate the OAuth keys

Configuration > People > Simple OAuth (/admin/config/people/simple_oauth):

If the Generate keys button is absent, the PHP OpenSSL extension is disabled. Create an RSA key pair manually and enter the two file paths in the Public Key and Private Key fields.

2. Create the preview service user

People > Add user (/admin/people/create):

This is the account the preview token acts as.

3. Configure the default consumer

Configuration > Web services > Consumers (/admin/config/services/consumer), edit Default Consumer:

The nextjs_preview role and OAuth scope already exist. Select them here; do not recreate them.

Storing the secret on Pantheon

Keep the shared secret out of code with Pantheon Secrets Manager (Terminus 4.2+):

Read it at runtime in web/sites/default/settings.php and apply it when setting the consumer secret:

Generate the OAuth keys (step 1) into the private files directory. It persists across deploys, while the code directory is read-only on Test and Live.

Front-end configuration

Each Next.js front end authenticates with the consumer and requests the scope:

Each vertical recipe registers its next_site with preview_url set to <front end>/api/draft and revalidate_url set to <front end>/api/revalidate, which the front end implements.

Verify

A successful response returns an access_token with a non-zero expires_in. Then use Preview on an unpublished node in Drupal, and the front end enters draft mode and renders it.


All versions of pantheon_nextjs_multi_demo with dependencies

PHP Build Version
Package Version
Requires drupal/core Version >=10.4
drupal/next Version ^2.1
drupal/decoupled_router Version ^2.0
drupal/consumers Version ^1.24
drupal/simple_oauth Version ^6.1
drupal/pathauto Version ^1.15
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pantheon-systems-ps/pantheon_nextjs_multi_demo contains the following files

Loading the files please wait ...