Skip to main content

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​

PackageContents
@intra-mart/smartlimeThe SDK for working with iAP. Provides login, API calls, displaying iAP screens, and more
@intra-mart/smartlime-uiUI components that use smartlime. Provides a login screen, a search screen, and a calendar

Use the two packages at the same version.

Main Features​

FeatureContentsMain components
Logging in to iAPLogs 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 revokedSmartlime, useAuthState, useStartAuth
Logged-in user informationGets information about the logged-in user and the modules installed on iAPuseMe, useIMModules
Calling iAP APIsCalls 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 resentuseIMFetch
Displaying iAP screensCreates an iAP session from the current token and displays iAP screens (such as a workflow application screen) inside the appIMWebView
Search and selectionLets the user search for and select users, organizations, positions, public groups, and rolesuseIMSearch, DefaultSearchUI
CalendarDisplays an iAP calendar (business days and holidays) and lets the user select a dateIMCalendar
Conversations with IM-CopilotChats with an IM-Copilot assistantuseAssistant

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.

ItemContents
ModuleMobile Application Integration (jp.co.intra_mart.im_smacolow) must be installed. Many smartlime features call the APIs provided by this module
OAuth clientThe app must be registered as an OAuth client. For the values to register, see AI Native Development Flow
IM-CopilotOnly 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.

smartlimeExpo SDK
3.0.056

When you create a mobile project with Accel CLI, you can select only the Expo SDKs that smartlime supports.

About updating the Expo SDK

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.