# lost-invention-mission.md title: Lost Invention Mission # Lost Invention Mission The Lost Invention Mission is an interactive guide that helps users understand how to utilize the API for retrieving information about lost inventions. This document provides step-by-step instructions and code samples in both TypeScript and Python. ## Before You Begin Make sure you have the following before you start: - Your API key - The base API URL ## Configure Your API Key and Base URL To interact with the API, you need to set your API key and base URL. You can do this in the code samples provided below. ## Add Steps for Left Panel Define a section in the left panel by wrapping content with the `step` tag. Each step must have a unique `id`. ### Step 1: Set Up Your Environment 1. Clone the repository. 2. Navigate to the `_filesets` directory for the language you want to use (TypeScript or Python). 3. Install the necessary dependencies. ### Step 2: Configure API Key and Base URL In the `usage.ts` or `usage.py` file, set your API key and base URL as follows: ```typescript // TypeScript const apiKey = 'YOUR_API_KEY'; const baseUrl = 'YOUR_BASE_API_URL'; ``` ```python # Python api_key = 'YOUR_API_KEY' base_url = 'YOUR_BASE_API_URL' ``` ### Step 3: Make API Requests Use the SDK functions to make requests to the API. Refer to the `usage.ts` or `usage.py` file for examples of how to call these functions. ```typescript // TypeScript import { fetchInventions } from './sdk'; fetchInventions(apiKey, baseUrl); ``` ```python # Python from sdk import fetch_inventions fetch_inventions(api_key, base_url) ``` ## Chunks for Right Panel Use chunk annotations to control which lines are highlighted in the right panel when a step becomes active in a code walkthrough. ### TypeScript SDK Implementation ```typescript sdk.ts export async function fetchInventions(apiKey: string, baseUrl: string) { const response = await fetch(`${baseUrl}/inventions`, { headers: { 'Authorization': `Bearer ${apiKey}` } }); return response.json(); } ``` ### TypeScript Usage Example ```typescript usage.ts import { fetchInventions } from './sdk'; const apiKey = 'YOUR_API_KEY'; const baseUrl = 'YOUR_BASE_API_URL'; fetchInventions(apiKey, baseUrl).then(data => { console.log(data); }); ``` ### Python SDK Implementation ```python sdk.py import requests def fetch_inventions(api_key, base_url): response = requests.get(f"{base_url}/inventions", headers={ 'Authorization': f'Bearer {api_key}' }) return response.json() ``` ### Python Usage Example ```python usage.py from sdk import fetch_inventions api_key = 'YOUR_API_KEY' base_url = 'YOUR_BASE_API_URL' data = fetch_inventions(api_key, base_url) print(data) ``` ## Resources - Refer to the README files in the `_filesets/typescript` and `_filesets/python` directories for installation instructions and additional details on running the scripts.