References

References are links to information that lives outside your universe.

They can point to anything: documentation, code, datasets, research, designs, or dashboards.

Sprig supports two common patterns:

  • Raw URLs for the simplest possible links.
  • Repositories + paths when you want reusable base URLs.

Raw URLs

Raw URLs are the simplest form. Copy a URL from your browser and paste it into url.

reference ConfluenceDoc {
  kind { 'documentation' }
  url { 'https://confluence.atlassian.com/x/44qLKw' }
  describe {
    Learn more about whatever 44qLKw is.
  }
}

reference ItemDataFolder {
  kind { 'data' }
  url { 'https://github.com/owner/repository/tree/main/data/items' }
  describe {
    These files contain the structured data for items.
  }
}

Use raw URLs when:

  • the target doesn’t have a predictable structure
  • you only need one link
  • you don’t expect to reuse a base URL elsewhere

Repositories and paths

A repository is a named base URL that you can reuse across references.

Despite the name, a repository does not have to be a git repository. It can point to any browsable collection (documentation, code, data, or anything else) as long as it can produce stable URLs.

Declare the repository once:

repository ExternalRepo {
  url { 'https://github.com/owner/repository/tree/main' }
  describe {
    This repository contains our source code.
  }
}

Then define references inside it using paths:

reference ItemDataFolder in ExternalRepo {
  kind { 'data' }
  paths {
    '/data/items'
  }
  describe {
    These files contain the structured data for items.
  }
}

Paths are appended to the repository’s base URL to form a navigable link.


Attaching references

Any block that supports references can include a references field.

concept SomeConcept {
  references {
    ItemData
  }
}

Notes on lists

In list-style fields such as paths and references, commas are optional. They are treated as visual separators only.