> 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/sdk/domains-api/share/share.createlink.md).

# Share.createLink

> 함수형 API `getTossShareLink`로도 같은 기능을 쓸 수 있어요. 함수형 API는 `getTossShareLink(path, ogImageUrl)` 형태의 위치 인자를 받아요.

### 기능 설명

지정한 경로를 토스 앱에서 열 수 있는 공유 링크를 만들어요. 이 링크를 공유하면 토스 앱이 실행되면서 지정한 경로로 진입해요. 토스앱이 없는 사람은 iOS에서는 앱스토어로, Android에서는 플레이스토어로 이동해요.

경로는 `intoss://`로 시작하는 딥링크 형식이어야 해요. 예를 들어 `intoss://my-app` 또는 `intoss://my-app/about?name=test`처럼 작성해요.

선택적으로 OG 이미지 URL(`ogImageUrl`)을 전달할 수 있어요. `ogImageUrl`은 토스앱 Android `5.240.0`, iOS `5.239.0` 이상에서만 적용돼요. 그 미만 버전에서는 기본 공유 링크에 `deep_link_value` 쿼리를 붙여 링크를 만들어요.

### 타입

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

**Params**

```ts
{
  /** 딥링크로 열고 싶은 경로예요. `intoss://`로 시작해야 해요. */
  path: string;
  /** 공유 링크 미리보기에 사용할 OG 이미지 URL이에요. */
  ogImageUrl?: string;
}
```

**Response**

토스 앱에서 열 수 있는 공유 링크 문자열을 반환해요.

### 예시 코드

#### 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/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.
