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
Flexibits documents x-cardhop://, parse, show, and preferences URL handlers. This module only covers those documented handlers and parameters.
Open
Open Cardhop.
import { open } from 'protocol-launcher/cardhop'
const url = open()Parse
Open Cardhop's parser with the documented s text parameter.
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.
import { parse } from 'protocol-launcher/cardhop'
const url = parse({
s: 'Sarah Jones',
list: 'Friends',
add: '1',
})Show
Show a contact by name or identifier.
import { show } from 'protocol-launcher/cardhop'
const url = show({
contact: 'Mike Ross',
})Show a contact with a documented action and list filter.
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.
import { show } from 'protocol-launcher/cardhop'
const url = show({
view: 'contacts',
list: 'Friends',
})Preferences
Open a supported Cardhop preferences path.
import { preferences } from 'protocol-launcher/cardhop'
const url = preferences({
path: 'notifications',
})