FigraniumAppFunctionClientProvider so your app controls authentication and secrets. AppFunctions never accept credentials as parameters.
AppFunctions support requires Android API 36+ (compileSdk 37). On devices with an older version,
FigraniumAppFunctions.setEnabled is a no-op and the base SDK works unchanged.Install the integration
Add the optionalfigranium-appfunctions artifact and KSP in your module’s build.gradle.kts.
build.gradle.kts
@AppFunctionServiceEntryPoint annotation. For more on Android platform setup, see the Android AppFunctions documentation.
Configure the client provider
Before the system can invoke any Figranium AppFunction, callFigraniumAppFunctionConfiguration.configure(_:) once from Application.onCreate with a provider that vends a configured Figranium client.
MyApplication.kt
IllegalStateException with the message: Configure FigraniumAppFunctionConfiguration before invoking Figranium AppFunctions.
Service and available AppFunction
BaseFigraniumAppFunctionService
Extend this abstract service in your app to host the generated AppFunction entry point. KSP processes the@AppFunctionServiceEntryPoint annotation and generates the corresponding metadata XML.
Signature:
- The
@AppFunctionmethod is declared withisEnabled = false. It is disabled by default. - The service requires API 36 at runtime.
runFigraniumTask
Runs one explicitly approved deterministic Figranium task. Signature:- Parameter:
RunFigraniumTaskParameterswith a singletaskIdfield, the ID of an app-approved deterministic task. - Returns:
FigraniumAppFunctionResultcontaining:outcome(String): the Figranium execution outcome such assuccessorerror. Falls back tounknownwhen the server omits it.data(String?): JSON output from the approved task.runId(String?): the run ID, if returned by Figranium.
- HTTP endpoint:
POST /tasks/{id}/api(viaclient.runTask<JsonObject>(taskId))
Data types
Control the task allowlist and availability
FigraniumAppFunctions is an object that manages which tasks assistants are allowed to run.
- Only task IDs present in the configured set can be executed through AppFunctions.
- Calling
runFigraniumTaskwith a task ID outside the allowlist throws anIllegalStateExceptionwith the message:This task is not approved for AppFunctions execution.
Enable or disable the AppFunction
setEnabledis safe to call on devices below API 36 (it returns immediately with no effect).- When enabled, the generated AppFunction becomes discoverable by Android assistants and agents.
Security notes
- Keep API keys in Android Keystore-backed storage or another secure app-owned store. Never pass credentials as AppFunction parameters.
- The allowlist means an assistant can run only the tasks your app explicitly approves. It cannot create arbitrary browser actions or read Figranium credentials.
- If the provider throws, the exception propagates through the AppFunction runtime.
Error reference
Tasks
Save, run, and manage deterministic tasks to allowlist for AppFunctions.
Client configuration
Review base URL, timeouts, and custom headers for the Figranium client.
Actions
Build deterministic action sequences for tasks that you expose through AppFunctions.