diff --git a/docs/fern/docs/pages/sdk/calculate-total-price.mdx b/docs/fern/docs/pages/sdk/calculate-total-price.mdx new file mode 100644 index 0000000000..1ba827b32d --- /dev/null +++ b/docs/fern/docs/pages/sdk/calculate-total-price.mdx @@ -0,0 +1,26 @@ +--- +title: calculateTotalPrice +--- + +# calculateTotalPrice + +Calculates the total price of items in a cart. + +## Parameters + +- `items`: An array of `CartItem` objects. Each `CartItem` should have `price` and `quantity` properties. + +## Example + +```tsx +import { calculateTotalPrice } from '@stackframe/stack'; + +const cartItems = [ + { price: 10, quantity: 2 }, + { price: 15, quantity: 1 }, + { price: 5, quantity: 3 } +]; + +const total = calculateTotalPrice(cartItems); +console.log(total); // Output: 45 +``` \ No newline at end of file diff --git a/docs/fern/docs/pages/sdk/social-media-icons.mdx b/docs/fern/docs/pages/sdk/social-media-icons.mdx new file mode 100644 index 0000000000..a5b8f8bdad --- /dev/null +++ b/docs/fern/docs/pages/sdk/social-media-icons.mdx @@ -0,0 +1,22 @@ +--- +title: SocialMediaIcons +--- + +# SocialMediaIcons + +A component that renders social media icons with links. + +## Example + +```tsx +import { SocialMediaIcons } from '@stackframe/stack'; + +const MyComponent = () => { + return ( +
+

Connect with me

+ +
+ ); +}; +``` diff --git a/docs/fern/docs/pages/sdk/use-stack-frame-api.mdx b/docs/fern/docs/pages/sdk/use-stack-frame-api.mdx new file mode 100644 index 0000000000..b0fef7d7d3 --- /dev/null +++ b/docs/fern/docs/pages/sdk/use-stack-frame-api.mdx @@ -0,0 +1,32 @@ +--- +title: useStackFrameApi +--- + +# useStackFrameApi + +A custom hook that provides access to the StackFrame API client. + +## Parameters + +- `options` (optional): An object with the following properties: + - `apiKey` (optional): A string representing the API key for authentication. + +## Example + +```tsx +import { useStackFrameApi } from '@stackframe/stack'; + +function MyComponent() { + const api = useStackFrameApi({ + apiKey: 'your-api-key-here', + }); + + // Use the api object to make API calls + // For example: + // api.someEndpoint.someMethod() + + return ( + // Your component JSX + ); +} +``` \ No newline at end of file