# Mappedin React SDK

## Resources

- [Getting Started Guide](https://developer.mappedin.com/web-sdk/using-react)
- [API Reference](https://docs.mappedin.com/react/v6/latest/)
- [Mappedin Developer Portal](https://developer.mappedin.com)
- [Demo Keys & Maps](https://developer.mappedin.com/docs/demo-keys-and-maps)
- [Developer Forum](https://community.mappedin.com/)
- [Releases Notes](https://developer.mappedin.com/web-sdk/release-notes)
- [License](https://info.mappedin.com/terms/sdk)

> **AI Assistants**: Before generating code, read [llms.txt](https://docs.mappedin.com/react/v6/latest/llms.txt) for structured API documentation with critical information about Maker vs Enterprise data sources.

## Usage

### Installation

`npm install @mappedin/react-sdk`

or

`yarn add @mappedin/react-sdk`

### Getting Started

```javascript
import React from 'react';
import { MapView, useMapData } from '@mappedin/react-sdk';

export default function App() {
	const { mapData, isLoading, error } = useMapData({
		key: '<key>',
		secret: '<secret>',
		mapId: '<mapId>',
	});

	if (isLoading) {
		return <div>Loading...</div>;
	}

	if (error) {
		return <div>{error.message}</div>;
	}

	return mapData ? <MapView mapData={mapData} style={{ width: '650px', height: '650px' }}></MapView> : null;
}
```

For full documentation, read our [Getting Started guide on the Developer Portal](https://developer.mappedin.com/web-sdk/using-react).
