What Is smartlime
smartlime is an SDK for using iAP from mobile apps built with Expo. It is published as the npm package @intra-mart/smartlime (MIT License).
An app that works with iAP always needs to log in to iAP, store and refresh access tokens, and call iAP APIs. smartlime provides these as React components and hooks, so app developers can focus on screens and business logic.
What Is Expo
Expo is a framework and set of tools for developing mobile apps with React Native. From a single codebase written in TypeScript, you can build apps for both iOS and Android.
- Expo SDK: A set of libraries that make native features, such as the camera and secure storage, available from JavaScript. Versions are identified by number, such as SDK 56, and APIs may change between versions.
- Expo Router: A mechanism that defines screen navigation by where files are placed.
- EAS (Expo Application Services): Cloud services for building apps, submitting them to stores, and delivering updates.
Packages
| Package | Contents |
|---|---|
@intra-mart/smartlime | The SDK for working with iAP. Provides login, API calls, displaying iAP screens, and more |
@intra-mart/smartlime-ui | UI components that use smartlime. Provides a login screen, a search screen, and a calendar |
Use the two packages at the same version.
Main Features
| Feature | Contents | Main components |
|---|---|---|
| Logging in to iAP | Logs in with OAuth 2.0 (authorization code + PKCE), using iAP as the authorization server. Tokens are stored in the device's secure storage and are refreshed automatically before they expire or when they are revoked | Smartlime, useAuthState, useStartAuth |
| Logged-in user information | Gets information about the logged-in user and the modules installed on iAP | useMe, useIMModules |
| Calling iAP APIs | Calls REST APIs such as those of IM-Workflow with the access token attached. If the token has expired, it is refreshed and the request is resent | useIMFetch |
| Displaying iAP screens | Creates an iAP session from the current token and displays iAP screens (such as a workflow application screen) inside the app | IMWebView |
| Search and selection | Lets the user search for and select users, organizations, positions, public groups, and roles | useIMSearch, DefaultSearchUI |
| Calendar | Displays an iAP calendar (business days and holidays) and lets the user select a date | IMCalendar |
| Conversations with IM-Copilot | Chats with an IM-Copilot assistant | useAssistant |
How to implement each feature is described in the skill sets deployed to a mobile project. Tell the agent what you want to build, and it implements it by referring to the corresponding skill.
How It Works with iAP
When you wrap the whole app in the Smartlime component, the smartlime hooks become available on the screens inside it.
The app never handles iAP user names or passwords. Login takes place on the iAP login screen, and the app uses only the resulting tokens.
What iAP Needs
The iAP that the app works with needs the following.
| Item | Contents |
|---|---|
| Module | Mobile Application Integration (jp.co.intra_mart.im_smacolow) must be installed. Many smartlime features call the APIs provided by this module |
| OAuth client | The app must be registered as an OAuth client. For the values to register, see AI Native Development Flow |
| IM-Copilot | Only when using conversations with an assistant. IM-Copilot must be installed and an assistant must be configured |
Supported Expo SDK
Each smartlime version supports a specific Expo SDK.
| smartlime | Expo SDK |
|---|---|
| 3.0.0 | 56 |
When you create a mobile project with Accel CLI, you can select only the Expo SDKs that smartlime supports.
Do not raise the app's Expo SDK until smartlime supports the new SDK. Expo tools (such as expo-doctor) may recommend updating the SDK, but smartlime does not work on SDKs it does not support.