JK
JustKalm

Mobile SDKs

Native mobile integration for iOS, Android, and cross-platform apps

Build powerful shopping experiences with product intelligence directly in your mobile app. Barcode scanning, real-time analysis, and offline caching included.

Barcode Scanning

Instant product lookup from EAN, UPC, and QR codes

Secure Storage

API keys stored in device keychain/keystore

Offline Mode

Cache product data for offline access

Type Safe

Full type definitions for all platforms

Installation

React Native
v2.5.0
npm install @justkalm/react-native

Configuration

react-native
// App.tsx
import { JustKalmProvider } from '@justkalm/react-native';

export default function App() {
  return (
    <JustKalmProvider 
      apiKey={process.env.JUSTKALM_API_KEY}
      environment="production"
    >
      <NavigationContainer>
        <MainStack />
      </NavigationContainer>
    </JustKalmProvider>
  );
}

Using Hooks

react-native
// components/ProductScanner.tsx
import { useJustKalm, useProductAnalysis } from '@justkalm/react-native';
import { Camera, useCameraDevice } from 'react-native-vision-camera';

export function ProductScanner() {
  const device = useCameraDevice('back');
  const { analyzeBarcode, isLoading } = useJustKalm();
  const [product, setProduct] = useState(null);

  const onBarcodeScanned = async (barcode: string) => {
    const result = await analyzeBarcode(barcode);
    setProduct(result);
  };

  return (
    <View style={styles.container}>
      <Camera
        device={device}
        isActive={true}
        codeScanner={{
          codeTypes: ['ean-13', 'qr'],
          onCodeScanned: (codes) => onBarcodeScanned(codes[0].value),
        }}
      />
      
      {isLoading && <ActivityIndicator />}
      
      {product && (
        <ProductCard
          name={product.name}
          healthScore={product.healthScore}
          valuation={product.valuation}
        />
      )}
    </View>
  );
}

Component Example

tsx
// hooks/useHealthScore.ts
import { useProductAnalysis } from '@justkalm/react-native';

export function ProductHealthCard({ productUrl }: { productUrl: string }) {
  const { data, isLoading, error } = useProductAnalysis(productUrl, {
    includeHealthScore: true,
    includeSustainability: true,
  });

  if (isLoading) return <LoadingSkeleton />;
  if (error) return <ErrorCard error={error} />;

  return (
    <View style={styles.card}>
      <HealthScoreCircle score={data.healthScore.overall} />
      <Text style={styles.brand}>{data.brand}</Text>
      <Text style={styles.name}>{data.name}</Text>
      
      <View style={styles.metrics}>
        <MetricRow 
          label="Material Safety" 
          value={data.healthScore.materialSafety} 
        />
        <MetricRow 
          label="Environmental" 
          value={data.healthScore.environmentalImpact} 
        />
        <MetricRow 
          label="Circularity" 
          value={data.sustainability.circularityScore} 
        />
      </View>
    </View>
  );
}

Platform Notes

• Requires React Native 0.70+ and React 18+

• For barcode scanning, install react-native-vision-camera

• Expo users: Use the development client for native modules

• TypeScript definitions included in the package