
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
@boundaryml/baml-nextjs-plugin
Advanced tools
Next.js integration for BAML, providing seamless support for server components, server actions, and streaming responses.
npm install @boundaryml/baml @boundaryml/nextjs
// next.config.ts
import { withBaml } from '@boundaryml/nextjs';
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
// ... your existing config
};
export default withBaml()(nextConfig);
// app/actions/story.ts
'use server'
import { b } from "@/baml_client";
export async function writeMeAStoryAction(prompt: string) {
return b.WriteMeAStory.stream(prompt).toStreamable();
}
// app/components/story.tsx
'use client'
import { useWriteMeAStoryAction } from "@/baml_client/nextjs";
export function StoryForm() {
const {
data: finalStory,
partialData: streamingStory,
isLoading,
isError,
error,
mutate
} = useWriteMeAStoryAction();
const story = isLoading ? streamingStory : finalStory;
return (
<div>
<button onClick={() => mutate("Once upon a time...")}>
Generate Story
</button>
{isLoading && <p>Generating story...</p>}
{story && (
<div>
<h2>{story.title}</h2>
<p>{story.content}</p>
</div>
)}
</div>
);
}
withBaml
withBaml(config?: BamlNextConfig)
Wraps your Next.js configuration with BAML integration.
interface BamlNextConfig {
webpack?: NextConfig['webpack']; // Custom webpack configuration
}
For each BAML function, a corresponding React hook is generated with the following interface:
interface BamlStreamHookResult<T> {
data?: T; // Final result
partialData?: T; // Streaming result
isLoading: boolean; // Loading state
error?: Error; // Error state
mutate: (input: any) => Promise<void>; // Function to call the BAML function
}
MIT
FAQs
BAML Next.js integration
The npm package @boundaryml/baml-nextjs-plugin receives a total of 185 weekly downloads. As such, @boundaryml/baml-nextjs-plugin popularity was classified as not popular.
We found that @boundaryml/baml-nextjs-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.