Skip to main content
Shareable links are configured at the network level. The SDKs fetch the configured domain and URL patterns so your app can build links to Social+ content using your own routing scheme. The current SDKs expose this configuration differently:
PlatformSDK surface
TypeScriptClient.getShareableLinkConfiguration() returns helper methods such as generateLink, getPattern, and isEnabled.
iOSclient.getShareableLinkConfiguration() returns domain and patterns.
AndroidAmityCoreClient.getShareableLinkConfiguration().getShareableLink() returns domain and patterns.
FlutterNo public shareable-link configuration API was found in the current Flutter SDK source.
The SDK reads the configured patterns. It does not create the destination screens in your app. Your app still needs routes that can open the generated URLs.

Parameters

OperationParameterRequiredDescription
Fetch configurationNoneNoReads the network-level shareable-link configuration.
Generate a post linkpostIdYesPost ID used to replace {postId} in the configured URL pattern.
Generate a post linkposts patternYesPattern returned by the backend configuration for post links.
Generate a post linkdomainYesConfigured shareable-link domain returned by the SDK.

Supported Pattern Keys

TypeScript maps content types to these pattern keys:
Content typePattern keyPlaceholder
Postposts{postId}
Communitycommunities{communityId}
Userusers{userId}
Livestreamlivestream{livestream}
Eventevents{eventId}
iOS and Android return the backend patterns map directly. Check that the key you need exists before generating a link.

Generate a Post Link

Fetch the shareable-link configuration before generating a post link, then fall back gracefully if the needed pattern is missing.
import { AmitySharableContentType, Client } from "@amityco/ts-sdk";

async function getPostShareLink(postId: string) {
  const config = await Client.getShareableLinkConfiguration();

  return config.generateLink(AmitySharableContentType.POST, postId);
}
let postId = "post-id"
let config = try await client.getShareableLinkConfiguration()

if let pattern = config.patterns["posts"] {
    let link = config.domain + pattern.replacingOccurrences(
        of: "{postId}",
        with: postId
    )
    showInfo(link)
}
AmityCoreClient.getShareableLinkConfiguration()
    .getShareableLink()
    .subscribe({ config ->
        val pattern = config.getPatterns()["posts"]
        val link = pattern?.let {
            config.getDomain() + it.replace("{postId}", postId)
        }
    }, { error ->
        handleGeneralError(error)
    })
Event links are the primary use case for shareable links: an app can copy or share a direct link to an event detail screen. Gate the share UI on isEnabled first, then generate the link — generateLink returns null when the event pattern is not configured.
import { AmitySharableContentType, Client } from "@amityco/ts-sdk";

async function getEventShareLink(eventId: string) {
  const config = await Client.getShareableLinkConfiguration();

  // Feature gate — hide the share action when event links aren't configured
  if (!config.isEnabled(AmitySharableContentType.EVENT)) return null;

  return config.generateLink(AmitySharableContentType.EVENT, eventId);
  // → "https://app.example.com/events/abc123" or null
}
let eventId = "event-id"
let config = try await client.getShareableLinkConfiguration()

// Feature gate — hide the share action when event links aren't configured
guard config.isEnabled(.event) else { return }

if let link = config.generateLink(.event, referenceId: eventId) {
    showInfo(link)
}
AmityCoreClient.getShareableLinkConfiguration()
    .subscribe({ config ->
        // Feature gate — hide the share action when event links aren't configured
        if (config.isEnabled(AmitySharableContentType.EVENT)) {
            val link = config.generateLink(AmitySharableContentType.EVENT, eventId)
            // ... copy or share `link`
        }
    }, { error ->
        handleGeneralError(error)
    })
Shareable links are available on TypeScript, iOS, and Android. Flutter has no public shareable-link configuration API in the current SDK source.

Best Practices

  • Treat missing patterns as a disabled share target for that content type.
  • Generate links only after the content exists and you have the final content ID.
  • Keep app route handling separate from link generation so deleted or restricted content can show a useful fallback screen.
  • Cache the configuration during a session if your sharing UI needs it often.

Posts Overview

Learn how posts are modeled and created.

Communities

Share community destinations after configuring community URL patterns.

User Management

Share user profile destinations after configuring user URL patterns.

Events

Share event links after configuring the event URL pattern.