# Function: challengeLink()

> **challengeLink**(`data`, `base?`): `string`

Defined in: [link.ts:29](https://github.com/debuffjp/debuff/blob/3e11cb8bf00adfd52d063977f9e3328e72e765c5/packages/share/src/link.ts#L29)

A link that opens this game with `data` attached, for "beat my run" sharing. Pair it with a seeded
`game.random` so the friend plays the same run.

```ts
const url = challengeLink({ seed: game.random.seed, score: 4200 });
```

The data is visible in the URL, so put game state in it, never anything personal.

## Parameters

### data

[`ChallengeData`](../type-aliases/ChallengeData.md)

### base?

`string` = `location.href`

## Returns

`string`
