@ -146,7 +146,7 @@ The `handlePendingSignIn` method is then used to handle that state, returning a
The authenticated state can later be detected by the `isUserSignedIn` method in case any particular handling is needed then.
~> Note that implementing `handlePendingSignIn` is especially important for supporting authentication within the context of mobile apps.
~> It's especially important to implement `handlePendingSignIn` within the context of mobile apps.
If the user has indeed confirmed authentication in the context of a popup window, the authenticator will resolve the pending authentication state automatically with the app within the parent window.
@ -14,7 +14,7 @@ Data storage provides a way for users to save both public and private data off-c
Storing data off the Stacks blockchain ensures that apps can provide users with high performance and high availability for data reads and writes without the involvement of centralized parties that could compromise their privacy or accessibility.
See the Todos app tutorial](/build-apps/tutorials/todos for a concrete example of this functionality in practice.
See the Todos app tutorial for a concrete example of this functionality in practice.
Users must authenticate to an app before the `storage` package will work to save or retrieve data on their behalf.
[See the authentication guide](/build-apps/guides/authentication) before proceeding to integrate the following data storage capabilities in cases where `userSession.isUserSignedIn()` returns `true`.
See the authentication guide before proceeding to integrate the following data storage capabilities in cases where `userSession.isUserSignedIn()` returns `true`.
[@page-reference]
| /build-apps/guides/authentication
## Save data for session user
@ -63,7 +66,7 @@ let fileData = {
purchaseDate: '2019-04-03',
};
let options = {
const options = {
encrypt: true,
};
@ -80,7 +83,7 @@ Whereas saving privately encrypted data is possible for all authenticated apps w
The `putFile` method returns the URL where the the file can be retrieved from the user's Gaia hub, as used here to set the value of `fileUrl`.
-> Note that you'll need to save an entirely new string of modified data using `putFile` with the same `fileName` every time you want to update a record. There is no separate update method.
-> You'll need to save an entirely new string of modified data using `putFile` with the same `fileName` every time you want to update a record. There is no separate update method.
Users must authenticate to an app before the `connect` package will work to prompt them for signing and broadcasting transactions to the Stacks blockchain with an authenticator such as [the Stacks Wallet](https://blockstack.org/wallet).
[See the authentication guide](/build-apps/guides/authentication) before proceeding to integrate the following transaction signing capabilities in cases where `userSession.isUserSignedIn()` returns `true`.
See the authentication guide before proceeding to integrate the following transaction signing capabilities in cases where `userSession.isUserSignedIn()` returns `true`.
[@page-reference]
| /build-apps/guides/authentication
## Prompt to transfer STX
@ -92,7 +95,7 @@ interface STXTransferOptions {
Call the `openContractDeploy` function provided by the `connect` package to trigger the display of a transaction signing prompt for deploying a smart contract:
```tsx
import { openContractDeploy } from '@stack/connect';
import { openContractDeploy } from '@stacks/connect';
@ -240,7 +243,7 @@ Each transaction signing method is itself available as a function returned by `u
- `openSTXTransfer` as `doSTXTransfer`
- `openContractDeploy` as `doContractDeploy`
Use these functions with the same parameters as outlined above. However, you don't have to specify `appDetails` since they are detected automatically if `useConnect` has been used already for authentication.
Use these functions with the same parameters as outlined above. However, you don't have to specify `appDetails` since they are detected automatically if `useConnect` has been used already [for authentication](/build-apps/guides/authentication#usage-in-react-apps).
```tsx
import { useConnect } from '@stacks/connect-react';
-> Note that we're also installing the `blockstack` package, as it's a [peer dependency](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependencies) of Stacks Connect
-> We're also installing the `blockstack` package, as it's a [peer dependency](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#peerdependencies) of Stacks Connect