> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buckspay.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Function: createRelayRoute()

# Function: createRelayRoute()

> **createRelayRoute**(`opts`, `deps?`): (`req`) => `Promise`\<`Response`>

Defined in: [packages/nextjs/src/routes.ts:46](https://github.com/bucks-pay/buckspay-sdk/blob/43ad599d2776cb5d657043c36847b3318093ccf4/packages/nextjs/src/routes.ts#L46)

App Router route handler that relays a signed intent to the facilitator with the apiKey
server-side. Returns the `Receipt` JSON. The apiKey is captured here and never serialized.

## Parameters

### opts

[`CreateRelayRouteOptions`](/sdk-reference/nextjs/src/interfaces/CreateRelayRouteOptions)

### deps?

[`CreateRelayRouteDeps`](/sdk-reference/nextjs/src/interfaces/CreateRelayRouteDeps) = `{}`

## Returns

(`req`) => `Promise`\<`Response`>
