[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › UrlSafeString

```ts
type UrlSafeString = string & Brand<"UrlSafeString">;
```

Defined in: [packages/common/src/Type.ts:1554](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Type.ts#L1554)

URL-safe string.

A `UrlSafeString` uses a limited alphabet that is safe for URLs:

- Uppercase letters (`A-Z`)
- Lowercase letters (`a-z`)
- Digits (`0-9`)
- Dash (`-`)
- Underscore (`_`)

This is the same character set used by Base64Url encoding, but this type does
not validate that the string is actually Base64Url-encoded data.

### Example

```ts
const result = UrlSafeString.from("abc123_-");
if (result.ok) {
  console.log("Valid URL-safe string:", result.value);
} else {
  console.error("Invalid URL-safe string:", result.error);
}
```