Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dittolive/ditto-react-native-tools

Package Overview
Dependencies
Maintainers
24
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dittolive/ditto-react-native-tools

React Native library for Ditto tools integration

beta
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
50%
Maintainers
24
Weekly downloads
 
Created
Source

@dittolive/ditto-react-native-tools

React Native library for Ditto tools integration

Installation

npm install @dittolive/ditto-react-native-tools @dittolive/ditto

or

yarn add @dittolive/ditto-react-native-tools @dittolive/ditto

Platform Setup

After installing this library, you need to configure your React Native app for Ditto.

Please follow the official Ditto React Native quickstart guide: React Native Setup

Environment Configuration

Create a .env file in your project root with your Ditto credentials:

DITTO_APP_ID=your_app_id_here
DITTO_TOKEN=your_playground_token_here  
DITTO_WEBSOCKET_URL=wss://your-websocket-url.com

Note: Copy .env.example to .env and update with your credentials. Never commit .env files to version control.

Usage

import React from 'react';
import { DittoProvider, PeersList } from '@dittolive/ditto-react-native-tools';
import { Ditto } from '@dittolive/ditto';
import Config from 'react-native-config';

// Initialize your Ditto instance using environment variables
const ditto = new Ditto({
  type: 'offlinePlayground',
  appID: Config.DITTO_APP_ID,
  offlineToken: Config.DITTO_TOKEN,
});

function App() {
  return (
    <DittoProvider ditto={ditto}>
      <PeersList 
        showConnectionDetails={true}
        emptyMessage="No peers discovered yet"
      />
    </DittoProvider>
  );
}

Keywords

react-native

FAQs

Package last updated on 06 Aug 2025

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