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

@expo/config-plugins

Package Overview
Dependencies
Maintainers
23
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/config-plugins

A library for Expo config plugins

  • 7.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
decreased by-18.15%
Maintainers
23
Weekly downloads
Ā 
Created

What is @expo/config-plugins?

The @expo/config-plugins package allows developers to customize and configure their Expo and React Native projects using JavaScript or TypeScript. This package provides an API for modifying the native app configuration files (like AndroidManifest.xml or Info.plist) programmatically, without having to eject from the managed Expo workflow. It enables the integration of native code and settings directly into an Expo managed project, making it easier to add custom functionality and configurations.

What are @expo/config-plugins's main functionalities?

Modifying app.json / app.config.js

This feature allows developers to programmatically modify the app's configuration. In this example, the Android app is given camera permissions by modifying the AndroidManifest.xml through the app.json or app.config.js file.

const { withPlugins, AndroidConfig } = require('@expo/config-plugins');

module.exports = withPlugins(myExpoConfig, [
  [AndroidConfig.Permissions.withPermissions, ['CAMERA']],
]);

Creating custom plugins

Developers can create custom config plugins to encapsulate and reuse configuration logic across multiple projects. This example demonstrates how to create a simple plugin that modifies the project configuration.

const { createRunOncePlugin, withPlugins } = require('@expo/config-plugins');

const withCustomPlugin = (config) => {
  // Modify the config.
  return config;
};

module.exports = createRunOncePlugin(withCustomPlugin, 'packageName', '1.0.0');

Integrating with native code

This feature enables direct modification of native project files, allowing for deeper integrations and customizations. The example shows how to use a dangerous mod to modify Android native files directly.

const { withDangerousMod } = require('@expo/config-plugins');

module.exports = function withCustomNativeCode(config) {
  return withDangerousMod(config, [
    'android',
    async (config) => {
      // Modify native Android files directly.
      return config;
    },
  ]);
};

Other packages similar to @expo/config-plugins

Keywords

FAQs

Package last updated on 04 Sep 2023

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