# App2App Dev. Guidelines

## Introduction

* [![](https://static.npmjs.com/da3ab40fb0861d15c83854c29f5f2962.png)npm: favorlet.js](https://www.npmjs.com/package/favorlet.js)
* **favorlet.js Web SDK** is for easy and convenient use when you want to request the following functions through FAVORLET app.

> A Request to bring user's FAVORLET account
>
> A Signature request to verify possession of FAVORLET wallet address
>
> A request to transfer platform coins on the chain set up in the FAVORLET wallet&#x20;
>
> A Contract execution request through FAVORLET wallet

## Install

* use `npm install favorlet.js yarn` or `add favorlet.js` and write as below.

```javascript
import { Request, createDeepLink, receipt } from "favorlet.js";
```

## Summary

<figure><img src="/files/6abGkghuiCDE8hSVhpua" alt=""><figcaption></figcaption></figure>

API request is proceed in the order of`Request`, `createDeepLink`, `receipt`.&#x20;

when`Request`, a unique Request ID is issued to distinguish it from other requests, and each step

communicates with this Request ID.&#x20;

Please refer to below information for more detailed explanation of each step.

## Request

There are four steps to request an action or transaction through the FAVORLET app.

{% hint style="info" %}

* `connectWallet`: A request to bring user's FAVORLET account
* `signMessage`: A signature request to verify possession of FAVORLET account
* `sendCoin`: A request to transfer platform coins on the chain set up in the FAVORLET
* `executeContract`: A Contract execution request through FAVORLET wallet
  {% endhint %}

## createDeepLink

Create an address (DeepLink) that meets the communication standard to deliver the requestId that is received when requesting from BApp to FAVORLET app.

{% hint style="info" %}
During development, the method of passing the generated DeepLink to the FAVORLET app must be handled differently depending on the BApp execution environment.&#x20;

* PC
  * Create a QR code using the DeepLink library and scan it with your smartphone.
  * For QR generation, refer to the library below
  * [![](https://static.npmjs.com/da3ab40fb0861d15c83854c29f5f2962.png)npm: qrcode](https://www.npmjs.com/package/qrcode)
* Mobile
  * Use window\.location.href and move to DeepLink
    {% endhint %}

{% hint style="info" %}
When running DeepLink, the corresponding branch will automatically activate depending on whether FAVORLET app is installed or not.&#x20;

* If installed: Run the FAVORLET app&#x20;
* If not installed: Go to the app store of your OS
  {% endhint %}

## receipt

Check the result of the action performed by the FAVORLET app with the requestId issued upon request.

{% hint style="info" %}
Response

* action: Request kind
* status
  * `requested`: requested status
  * `executed`: the status of executing the request
  * `canceled`: canceled request
  * `failed`: request executed but failed
  * `succeed`: request executed and succeed
    {% endhint %}

## Style Guide

Please refer to the page below for the service logo and terminology regulations.

{% embed url="<https://docs.favorlet.io/about/style>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.favorlet.io/english/dev/app2app.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
