import * as SecureStore from 'expo-secure-store'

const KEY = 'crumbs.llmKey'

export const getLlmKey = () => SecureStore.getItemAsync(KEY)

export const setLlmKey = (key: string) =>
  SecureStore.setItemAsync(KEY, key, {
    keychainAccessible: SecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
  })

export const clearLlmKey = () => SecureStore.deleteItemAsync(KEY)
