> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/sdk/domains-api/share/share.createlink.md).

# Share.createLink

> Functional API `getTossShareLink`You can use the same functionality here as well. The functional API `getTossShareLink(path, ogImageUrl)` takes positional arguments in the form of.

### Feature description

Creates a share link that can open the specified path in the Toss app. Sharing this link launches the Toss app and enters the specified path. If the person doesn't have the Toss app, it goes to the App Store on iOS or the Play Store on Android.

The path `intoss://`must be a deep link format that starts with. For example `intoss://my-app` or `intoss://my-app/about?name=test`write it like this.

Optionally, you can pass the OG image URL (`ogImageUrl`). `ogImageUrl`applies only to the Toss app on Android `5.240.0`, iOS `5.239.0` and above. For versions below that, `deep_link_value` it creates the link by appending the query to the default share link.

### Type

```ts
Share.createLink(params: { path: string; ogImageUrl?: string }): Promise<string>;
```

**Params**

```ts
{
  /** This is the path you want to open via deep link. It must start with `intoss://`. */
  path: string;
  /** OG image URL used for the share link preview. */
  ogImageUrl?: string;
}
```

**Response**

Returns a share link string that can be opened in the Toss app.

### Example code

#### JavaScript

```js
import { Share } from "@apps-in-toss/web-framework";

try {
  const tossLink = await Share.createLink({ path: "intoss://my-app" });
  await Share.sendMessage({ message: tossLink });
} catch (error) {
  console.error(error);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/sdk/domains-api/share/share.createlink.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
