Skip to content

gnoverse/safeurl-sdk

Repository files navigation

SafeURL SDKs

Official SDKs for the SafeURL API, an AI-powered URL safety screening service.

This repository contains:

  • Go SDK — Native Go client generated from OpenAPI.
  • TypeScript SDK — Type-safe TypeScript client generated from OpenAPI using Hey API.

Repository Structure

safeurl-sdk/
├── go/    # Go SDK source and generation scripts
└── ts/    # TypeScript SDK source and generation scripts

Installation

Go

go get github.com/gnoverse/safeurl-sdk/go

TypeScript

npm install @safeurl/sdk

Releases

This repo uses release-please with release-please-config.json. Merge the release pull request on main to tag releases and publish changelogs for the TypeScript (ts/) and Go (go/) packages.

Publishing @safeurl/sdk to npm from CI requires a repository secret NPM_TOKEN (automation token with publish access to the @safeurl scope). Without it, the release still completes on GitHub; the npm publish step fails until the secret is configured.

Development

These SDKs are generated from the SafeURL OpenAPI specification. The fetched spec is stored once at the repository root as openapi.json.

Prerequisites

Install just to use the repo's task runner:

brew install just   # macOS
# or: cargo install just

Common Tasks

Command Description
just gen Fetch the OpenAPI spec and regenerate both SDKs
just smoke Run Go and TypeScript smoke tests against a local API

Regenerating All SDKs

just gen

Or directly:

sh scripts/fetch-openapi.sh

Running SDK Smoke Tests

just smoke

Or directly:

sh scripts/test-sdk-smoke.sh

The script expects the local SafeURL stack to be running and reads the shared secret from ~/dev/safeurl/.env by default, or from SAFEURL_ENV_FILE / SAFEURL_REPO_DIR if you need to point at a different checkout. You can still override the secret with SAFEURL_SDK_TEST_SERVICE_SECRET or SAFEURL_SERVICE_SECRET. SAFEURL_SDK_TEST_BASE_URL defaults to http://localhost:8081.

License

Apache-2.0

About

SafeURL SDK

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors