Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gigscom/embeds-react-native

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gigscom/embeds-react-native

Gigs Embeds for React Native

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-59.09%
Maintainers
2
Weekly downloads
 
Created
Source

Gigs Embeds for React Native

Gigs Embeds for React Native

[!NOTE] This library is currently under development.

Installation

npm install @gigscom/embeds-react-native

Usage

When a user visits the screen in your app containing the Embed, request a Connect Session from your server endpoint. Afterward, you can render the Embed component.

Porting Embed
  1. Create a Gigs Connect Session on your own server.

  2. Pass the session object from your server to your app.

  3. Initialize the embed using the session object with an intent of type completePorting, your project ID and an onCompleted .

  4. Navigate the user to the next screen once the number porting is completed.

  5. You can also optionally pass what should happen when the component is loaded or if there is an error initializing it.

    const [isLoaded, setLoaded] = useState(false)
    \\ ...
    {Boolean(!isLoaded) &&  <YourLoadingSpinner />}
    <PortingEmbed
     connectSession={session}
     project="yourProject"
     onLoaded={() => setLoaded(true)}
     onError={(error) => setError(error)}
     onCompleted={() => navigate('SuccessScreen')}
     onSupportRequested={() => navigate('CustomerSupportScreen')}
    />
    
Porting Embed props
PropTypeRequiredDescription
connectSessionConnect Session objectA Connect Session object with an intent of type completePorting.
projectstringYour project ID.
onCompletedfunction(porting: Porting) => unknown Callback triggered when the number porting is completed.
onInitializedfunction() => unknown Callback triggered when the embed is initialized. Mostly useful for debugging purposes. In most cases you want to use onLoaded to know when the component is ready.
onLoadedfunction() => unknown Callback triggered when the embed form is loaded with a subscription and the related porting.
onErrorfunction(error: Error) => unknown Callback triggered when there is an error initializing the porting form. The error may stem from an invalid session, in which case recovery can be attempted by generating and passing a new Connect session to the embed. Alternatively, the error may derive from a failed attempt to retrieve a subscription, in which case it is advisable to inform the user to try again later or to contact customer support for assistance.
onSupportRequestedfunction() => unknown Callback triggered when the user has clicked the "Customer support" button. You can use it for example to open your own Customer support page.

Contributing

This project was bootstrapped with create-react-native-library.

See the contributing guide to learn how to contribute to the repository and the development workflow.

Keywords

FAQs

Package last updated on 11 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc