# lib/facebook-ref-link

> Source: https://devdocs.joy.so/joy-headless-api/sdk-reference/hydrogen/lib/facebook-ref-link/ · Last updated: 2026-11-25

## Interfaces

### FacebookRefLink

#### Properties

##### link

```ts
link: string;
```

The link to actually send the shopper to — device-appropriate.

##### mobileLink

```ts
mobileLink: string;
```

##### webLink

```ts
webLink: string;
```

***

### FacebookRefLinkParams

Everything [generateFacebookRefLink](#generatefacebookreflink) needs to sign a ref payload.

#### Properties

##### customerId

```ts
customerId: string;
```

Joy customer id; the ONLY identity the webhook links on.

##### pageId

```ts
pageId: string;
```

The shop's connected Facebook Page id (`blob.facebookPageId`).

##### shopDomain?

```ts
shopDomain?: string;
```

##### shopId

```ts
shopId: string;
```

Doubles as the HMAC key — see the file header.

##### shopifyCustomerId?

```ts
shopifyCustomerId?: string;
```

## Functions

### generateFacebookRefLink()

```ts
function generateFacebookRefLink(__namedParameters): Promise<FacebookRefLink>;
```

Build the Messenger deep link that carries this customer's signed ref.
Desktop gets the web messenger, mobile the `m.me` universal link, the same
links the Liquid storefront widget builds.

#### Parameters

| Parameter           | Type                                              |
| ------------------- | ------------------------------------------------- |
| `__namedParameters` | [`FacebookRefLinkParams`](#facebookreflinkparams) |

#### Returns

`Promise`<[`FacebookRefLink`](#facebookreflink)>
