- Language: TypeScript
- Framework: Vue.js with Capacitor
- Authentication: AppAuth for OAuth2
- Camera Integration: Capacitor Camera API for receipt image capture
- UI Components: Vue
-
TikiClient: The primary entry point for the TIKI Client Library.
-
TikiClient.auth: Handles authentication, token retrieval, revocation, and refresh.
-
TikiClient.license: Manages user licenses, including creation, retrieval, revocation, and verification.
-
TikiClient.email: Manages email-related operations such as adding, retrieving, and removing email accounts.
-
TikiClient.capture: Deals with capturing receipt images, downloading and publishing email receipt data, uploading receipt images, and checking publishing status.
-
TikiClient.clo: Handles card-linked offers, including adding cards, retrieving offers, getting user rewards, and publishing transaction information.
- Methods:
initialize(providerId: string, userId: string, company: CompanyInfo)
: Initializes the TikiClient with parameters.scan() -> Promise<string>
: Initiates the process of scanning a physical receipt and returns the receipt ID.login(provider: EmailProviderEnum)
: Initiates the process of scraping receipts from emails.logout(email: string)
: Removes a previously added email account.accounts() -> Promise<EmailAccount[]>
: Retrieves the list of connected email accounts.scrape()
: Initiates the process of scraping receipts from emails.card(last4: string, bin: string, issuer: string, network: string)
: Adds a card for card-linked offers.offers() -> Promise<Offer[]>
: Retrieves card-linked offers for the user.transaction(transaction: Transaction)
: Submits a transaction for card-linked offer matching.rewards() -> Promise<Reward[]>
: Retrieves information about the user's rewards.widget(theme: Theme?)
: Displays the widget for pre-built UIs with a custom theme.
- Methods:
authenticate() -> Promise<string>
: Authenticates with TIKI and saves the auth and refresh tokens.token() -> Promise<string>
: Retrieves the authentication token, refreshing if necessary.revoke() -> Promise<void>
: Revokes the authentication token.refresh() -> Promise<string>
: Refreshes the authentication token.
- Methods:
create() -> Promise<LicenseRecord>
: Creates a new license for the user.get() -> Promise<License>
: Retrieves the user's active license.revoke() -> Promise<License>
: Revokes the user's existing license.verify() -> Promise<boolean>
: Verifies the validity of the user's license.
- Methods:
login(provider: EmailProvider) -> Promise<void>
: Authenticates with OAuth and adds an email account for scraping receipts.accounts() -> Promise<EmailAccount[]>
: Retrieves the list of connected email accounts.logout(email: string) -> Promise<void>
: Removes a previously added email account.
- Methods:
camera() -> Promise<string>
: Captures an image of a receipt for processing.email(onPublish: (receiptId: string) => void) -> Promise<void>
: Downloads potential receipt data from known receipt email senders and publishes it.publish(data: ImageData) -> Promise<string>
: Uploads receipt images or email data for receipt data extraction.status(receiptId: string) -> Promise<PublishingStatus>
: Checks the publishing status of the data.
- Methods:
card(last4: string, bin: string, issuer: string, network: string) -> Promise<void>
: Adds a card to the user's account.offers() -> Promise<Offer[]>
: Retrieves card-linked offers for the user.rewards() -> Promise<Reward[]>
: Retrieves information about the user's rewards.transaction(transaction: Transaction) -> Promise<void>
: Sends transaction information to match card-linked offers.
The library should provide comprehensive documentation including:
- Getting Started Guide: Instructions on how to integrate the library into a Capacitor + Vue.js project.
- API Reference: Detailed documentation for each class, method, and parameter.
- Sample Code: Examples demonstrating how to use key functionalities of the library.
- Configuration Guide: Guidelines on setting up TIKI credentials and other necessary configurations.
- Error Handling: Information on handling errors and exceptions.
- Example App An example app with basic UI, for manual testing.
- AppAuth for OAuth2.
- Capacitor Camera API for image capture.