Browser helper SDK

Reuse small OpenToolsKit helpers without rebuilding them.

The SDK surface is intentionally small. It exists for helper functions that are easy to keep aligned with the live tools and useful enough to drop into docs, lightweight apps, or internal browser-side scripts.

HTMLLoad the SDK from OpenToolsKit
<script src="https://www.opentoolskit.com/opentoolskit-sdk.js"></script>
<script>
  const cleaned = OpenToolsKit.cleanHashtags('#SaaS #seo #SEO');
  console.log(cleaned.output);
</script>
HELPERcleanHashtags

Normalize a pasted hashtag block into a deduplicated, space-separated list.

Signature: OpenToolsKit.cleanHashtags(input: string) => { output, count }

JScleanHashtags example
OpenToolsKit.cleanHashtags('#SaaS #seo #SEO #buildinpublic')
// { output: '#saas #seo #buildinpublic', count: 3 }
HELPERformatInstagramLineBreaks

Trim and normalize caption spacing before a final paste into Instagram.

Signature: OpenToolsKit.formatInstagramLineBreaks(input: string) => string

JSformatInstagramLineBreaks example
OpenToolsKit.formatInstagramLineBreaks('Line one\n\n\nLine two')
// 'Line one\n\nLine two'
HELPERgenerateSlugs

Convert a newline list of headlines or labels into kebab-case slugs.

Signature: OpenToolsKit.generateSlugs(input: string) => { output, count }

JSgenerateSlugs example
OpenToolsKit.generateSlugs('Meta Title Draft\nAbout Page')
// { output: 'meta-title-draft\nabout-page', count: 2 }
HELPERbuildUtmUrl

Build a campaign URL from a base URL and consistent UTM fields.

Signature: OpenToolsKit.buildUtmUrl({ baseUrl, source, medium, campaign, term?, content? }) => string

JSbuildUtmUrl example
OpenToolsKit.buildUtmUrl({ baseUrl: 'https://example.com', source: 'newsletter', medium: 'email', campaign: 'launch' })
// 'https://example.com/?utm_source=newsletter&utm_medium=email&utm_campaign=launch'
HELPERbuildRobotsTxt

Generate a small robots.txt draft from a sitemap URL and disallow list.

Signature: OpenToolsKit.buildRobotsTxt(sitemapUrl: string, disallowPaths: string) => string

JSbuildRobotsTxt example
OpenToolsKit.buildRobotsTxt('https://example.com/sitemap.xml', '/admin\n/private')
// 'User-agent: *\nDisallow: /admin\nDisallow: /private\n\nSitemap: https://example.com/sitemap.xml'
HELPERencodeUrlValue

Encode a string for use inside a query parameter or URL fragment.

Signature: OpenToolsKit.encodeUrlValue(input: string) => string

JSencodeUrlValue example
OpenToolsKit.encodeUrlValue('utm source=creator launch')
// 'utm%20source%3Dcreator%20launch'