Skip to content

Cardhop

Cardhop is a contacts app from Flexibits. Protocol Launcher allows you to generate Cardhop links for opening the app, parsing contact actions, showing contacts or views, and opening supported preferences paths.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

Flexibits documents x-cardhop://, parse, show, and preferences URL handlers. This module only covers those documented handlers and parameters.

Open

Open Cardhop.

On-Demand
ts
import { open } from 'protocol-launcher/cardhop'

const url = open()

Parse

Open Cardhop's parser with the documented s text parameter.

On-Demand
ts
import { parse } from 'protocol-launcher/cardhop'

const url = parse({
  s: 'call Mike',
})

Use list to filter results, and use one of Cardhop's documented add values (Y, y, T, t, or 1-9) when a parsed new contact should be added immediately.

On-Demand
ts
import { parse } from 'protocol-launcher/cardhop'

const url = parse({
  s: 'Sarah Jones',
  list: 'Friends',
  add: '1',
})

Show

Show a contact by name or identifier.

On-Demand
ts
import { show } from 'protocol-launcher/cardhop'

const url = show({
  contact: 'Mike Ross',
})

Show a contact with a documented action and list filter.

On-Demand
ts
import { show } from 'protocol-launcher/cardhop'

const url = show({
  id: 'REPLACE_WITH_CONTACT_ID',
  action: 'mail',
  list: 'Team',
})

Show one of Cardhop's documented views.

On-Demand
ts
import { show } from 'protocol-launcher/cardhop'

const url = show({
  view: 'contacts',
  list: 'Friends',
})

Preferences

Open a supported Cardhop preferences path.

On-Demand
ts
import { preferences } from 'protocol-launcher/cardhop'

const url = preferences({
  path: 'notifications',
})

Official Documentation