Enable links
Declare the service inmarina.json. It requires an entrypoint:
marina.json
Create a link
Create links from your handler, usually while serving a signed-in request:
The path must be in normalized URL form: percent-encode non-ASCII characters
and do not encode
. characters. It cannot contain a query string, fragment,
whitespace, backslash, or . or .. segments, and it cannot be under
/__marina/ or /.marina/. An invalid input fails with INVALID_INPUT.
link.url uses the app’s Marina URL. A link created by the live version works
on any of the app’s URLs, including a custom domain: append
?marina_grant=<token> to the same path. A link created by a version that is
not live, such as a proposed version awaiting approval, opens only that
version.
How a link request is served
Link requests never redirect to sign-in and never set a Marina cookie.
Responses carry
Cache-Control: private, no-store and
Referrer-Policy: no-referrer, because the URL contains the link’s token.
What your app receives
Marina removes
marina_grant from the URL and removes the Cookie and
Authorization headers. x-platform-user-id is not set, so a link request
never carries the identity of whoever opened it. If your app needs to know
which user or record a link is for, store that in your own data when you
create the link, for example keyed by the path.
Examples
Install an iOS build withitms-services:
Expiry and security
A link cannot be revoked on its own. It stops working when it expires (at most 15 minutes after creation) or within 10 seconds of the app being archived. Anyone who has the URL can use it until then, so create links only for the path and methods the caller needs, with the shortest practical expiry. The token is removed before the request reaches your app, and Marina’s request logs for the app record only the path.Local development
Whenmarina.json declares runtime.grants, marina.grants.create works
under marina dev. Links point at the local URL,
and link requests reach your app with the same headers as in production. The
local server does not enforce a link’s path, methods, or expiry, so test those
against a deployed app.