Skip to main content

Links

This guide outlines how to connect multiple Skpr projects to support scalable and maintainable microservice architectures.

Linking one Project to Another​

The following example demonstrates how one project can reference another using the Skpr project configuration.

You can define a custom name or key, then specify the target project and environment accordingly.

If the environment is not explicitly set, it defaults to the name of the main project — for example: dev = dev, stg = stg, prod = prod.

link:
example:
project: project2
# This will default to the name of the current environment when not set.
# environment: dev

How to connect to a linked Project​

Automatic Skpr Configuration​

Once linked, Skpr automatically supplies your project with connection details through the Skpr Configuration System:

  • skpr.project.example.endpoint
  • skpr.project.example.token
$ skpr config list dev --show-secrets

╭────────────────────────────────┬──────────────────────────────────────────────────┬────────╮
│ Key │ Value │ Type │
├────────────────────────────────┼──────────────────────────────────────────────────┼────────┤
│ skpr.project.pdf.endpoint │ https://skpr-project-project2.alb.skpr.internal │ System │
│ skpr.project.pdf.token │ my-token │ System │
╰────────────────────────────────┴──────────────────────────────────────────────────┴────────╯

NOTE: The --show-secrets flag was used for context in the next step.

How do I use the Skpr Configuration?​

Below is an example using curl and the config values provided above.

curl -H "X-Skpr-Token: my-token" https://skpr-project-project2.alb.skpr.internal

Automate connectivity using our config libraries​

As an example, you can automatically connect these configuration values to your application using our config package together with Drupal’s settings.php file.

https://docs.skpr.io/integrations/drupal#step-1-ensure-you-have-skprconfig-as-a-composer-dependency

We also provide configuration libraries for other languages: