Firebase SDK 통합
Firebase SDK를 애플리케이션에 추가하고 다양한 서비스에서 사용할 수 있도록 초기화하는 방법을 이해합니다.
Firebase SDK 통합은(는) CoddyKit의 무료 Firebase Auth & Realtime Database Apps 강의입니다. 이것은 4개 중 3번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Firebase Auth & Realtime Database Apps 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Firebase Auth & Realtime Database Apps 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
Your App's Firebase Toolkit
The Firebase SDK (Software Development Kit) is the toolkit Firebase gives you — the code and tools that let your app talk to Firebase services.
Why Integrate the SDK?
Why the toolkit? Without the Firebase SDK, your app simply cannot reach Firebase. It is the bridge to auth, databases, storage, and the rest.
SDKs for Different Platforms
Each platform gets its own SDK: JavaScript for web, Java/Kotlin for Android, Swift for iOS, and wrapper SDKs for Flutter or React Native.
Web: Adding the SDK via CDN
For the web, the simplest way to add the SDK is script tags loading Firebase from a CDN. Include only the products you actually plan to use.
<!-- The core Firebase JS SDK must be loaded first -->
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script>
<!-- Add Firebase products you want to use -->
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-firestore-compat.js"></script>Your Firebase Configuration Object
Your app needs to know which project to reach, and that lives in the firebaseConfig object — API key, project ID, and more — found in Project settings.
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};Initializing Firebase in Web
With the SDK loaded and your config ready, initialize Firebase by calling firebase.initializeApp(config) to open the connection.
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// Now Firebase is ready to use!
// For example, you could then get the Auth service:
// const auth = firebase.auth();Try It: Full Web Init Example
Here is a complete minimal HTML page that loads the SDK via CDN and initializes it. Swap in your real config values and watch the console.
<!DOCTYPE html>
<html>
<head>
<title>Firebase Web Init</title>
</head>
<body>
<h1>Check the Console!</h1>
<!-- Firebase SDKs - make sure these are correct versions -->
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.23.0/firebase-auth-compat.js"></script>
<script>
// Your web app's Firebase configuration (replace with your actual config)
const firebaseConfig = {
apiKey: "AIzaSyC...", // Your actual API Key
authDomain: "your-project-id.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project-id.appspot.com",
messagingSenderId: "1234567890",
appId: "1:1234567890:web:abcdef123456"
};
// Initialize Firebase
const app = firebase.initializeApp(firebaseConfig);
console.log("Firebase app initialized successfully!");
console.log(app); // You can inspect the initialized app object
// Now you can access Firebase services, e.g.:
// const auth = firebase.auth();
// console.log("Firebase Auth service ready.");
</script>
</body>
</html>Accessing Firebase Services
After initializing, grab the services you need — like getAuth(app) or getFirestore(app) — from the initialized app instance.
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth"; // For Authentication
import { getFirestore } from "firebase/firestore"; // For Firestore Database
const firebaseConfig = { /* ... your config ... */ };
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// Get a reference to the Auth service
const auth = getAuth(app);
// Get a reference to the Firestore service
const db = getFirestore(app);
// Now 'auth' and 'db' are ready to be used in your app!Why Initialization is Crucial
Initialization is the handshake: your projectId picks the backend, your apiKey identifies the app, and the SDK wires up service access.
Quick Check: SDK Initialization
You've learned about integrating and initializing the Firebase SDK. Let's see if you can identify the correct first step in connecting your web app to Firebase.
Recap: SDK Integration
Recap: the Firebase SDK connects your app, you add it via CDN for web, your firebaseConfig names the project, and initializeApp opens the link.
자주 묻는 질문
“Firebase SDK 통합” 강의는 무료인가요?
네 — “Firebase SDK 통합” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Firebase Auth & Realtime Database Apps 강의 전체를 잠금 해제할 수 있습니다. Firebase Auth & Realtime Database Apps 강의에는 총 4개의 강의가 포함되어 있습니다.
“Firebase SDK 통합”에서 뭘 배우나요?
Firebase SDK를 애플리케이션에 추가하고 다양한 서비스에서 사용할 수 있도록 초기화하는 방법을 이해합니다. 브라우저에서 직접 실행하는 실습 코드로 Firebase Auth & Realtime Database Apps을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Firebase Auth & Realtime Database Apps을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Firebase Auth & Realtime Database Apps은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 3번째 강의입니다.
“Firebase SDK 통합” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Firebase Auth & Realtime Database Apps 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Firebase Auth & Realtime Database Apps 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- Firebase 생태계 소개
- 첫 프로젝트 설정하기
- Firebase SDK 통합
- Firebase 요금과 요금제 이해하기