@chi-ecosystem/core-logging-react-native
v1.0.5
Published
React Native integration for CHI ecosystem logging SDK
Readme
@chi-ecosystem/core-logging-react-native
React Native integration for CHI ecosystem logging SDK.
Note: This package is intended for use only within the CHI ecosystem and related projects.
Installation
npm install @chi-ecosystem/core-logging-react-nativeUsage
import { ChiLoggingProvider, useChiLogger } from '@chi-ecosystem/core-logging-react-native';
// Wrap your app with the provider
function App() {
return (
<ChiLoggingProvider apiKey="your-api-key" endpoint="https://your-endpoint">
<YourApp />
</ChiLoggingProvider>
);
}
// Use the logger in your components
function YourComponent() {
const logger = useChiLogger();
const handlePress = () => {
logger.info('Button pressed');
};
return <Button onPress={handlePress} title="Press me" />;
}License
MIT
