> 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 with it as well. The functional API is `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. When you share this link, the Toss app launches and enters the specified path. People without the Toss app are taken to the App Store on iOS and to the Play Store on Android.

The path `intoss://`must be in 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 an OG image URL (`ogImageUrl`) `ogImageUrl`is only available on Toss app Android `5.240.0`, iOS `5.239.0` and above. On earlier versions, the default share link has `deep_link_value` the query appended to create the link.

### Type

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

**Params**

```ts
{
  /** The path you want to open as a deep link. It must start with `intoss://`. */
  path: string;
  /** The OG image URL to use 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.
