Skip to content
← Public packages

@charlesmatte/granola

Search and read Granola meeting notes, summaries and transcripts from any agent; manage webhooks and legal holds safely.

src/lib/urls.ts

24 lines · 1.1 KB · TypeScript
Raw
import { GRANOLA_HOST } from './account.ts'

export const KODY_ORIGIN = 'https://kody.codes'
export const DOCS = {
	apiKeys: 'https://docs.granola.ai/help-center/sharing/integrations/granola-api',
	api: 'https://docs.granola.ai/introduction',
	webhooks: 'https://docs.granola.ai/webhooks',
	legalHolds: 'https://docs.granola.ai/legal-holds',
	auditEvents: 'https://docs.granola.ai/audit-events',
	audit: 'https://docs.granola.ai/audit',
}

/** Kody page that creates the secret with the Granola API host already allowed (value typed by the owner). */
export function secretSetupUrl(secretName: string): string {
	return (
		`${KODY_ORIGIN}/account/secrets/new?name=${encodeURIComponent(secretName)}` +
		`&description=${encodeURIComponent('Granola API key (grn_...)')}&allowedHosts=${encodeURIComponent(GRANOLA_HOST)}&scope=user`
	)
}

/** Kody page where the owner allows an existing secret to be sent to the Granola API host. */
export function hostApprovalUrl(secretName: string): string {
	return `${KODY_ORIGIN}/connect/secrets?name=${encodeURIComponent(secretName)}&hosts=${encodeURIComponent(GRANOLA_HOST)}`
}